
package com.ami.kvm.jviewer.gui;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.DisplayMode;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.WritableRaster;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.net.InetAddress;
import java.net.URL;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Locale;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import com.ami.iusb.CDROMRedir;
import com.ami.iusb.FloppyRedir;
import com.ami.iusb.HarddiskRedir;
import com.ami.iusb.IUSBRedirSession;
import com.ami.kvm.jviewer.Debug;
import com.ami.kvm.jviewer.JViewer;
import com.ami.kvm.jviewer.common.ISOCApp;
import com.ami.kvm.jviewer.common.ISOCCreateBuffer;
import com.ami.kvm.jviewer.common.ISOCFrameHdr;
import com.ami.kvm.jviewer.common.ISOCKvmClient;
import com.ami.kvm.jviewer.common.ISOCManager;
import com.ami.kvm.jviewer.common.oem.IOEMManager;
import com.ami.kvm.jviewer.communication.Connection;
import com.ami.kvm.jviewer.hid.KeyProcessor;
import com.ami.kvm.jviewer.hid.USBKeyProcessorEnglish;
import com.ami.kvm.jviewer.hid.USBKeyboardRep;
import com.ami.kvm.jviewer.hid.USBMouseRep;
import com.ami.kvm.jviewer.jvvideo.JVVideo;
import com.ami.kvm.jviewer.kvmpkts.IVTPPktHdr;
import com.ami.kvm.jviewer.kvmpkts.KVMClient;
import com.ami.kvm.jviewer.kvmpkts.KeepAlive;
import com.ami.kvm.jviewer.kvmpkts.Mousecaliberation;
import com.ami.kvm.jviewer.videorecord.URLProcessor;
import com.ami.kvm.jviewer.videorecord.VideoRecordApp;
import com.ami.vmedia.VMApp;
import com.ami.vmedia.gui.VMDialog;

public class JViewerApp {
	private static JViewerApp m_rcApp = new JViewerApp();
	private JVFrame m_frame;
	private KVMClient m_KVMClnt;
	private ISOCKvmClient sockvmclient;
	private static IOEMManager oemManager;
	private VideoRecordApp videorecordapp;
	private JViewerView m_view;
	private String m_encToken;
	private boolean m_wndMode = true;
	private WindowFrame m_wndFrame;
	private FSFrame m_fsFrame;
	private byte hostLEDStatus = 0;
	private byte clientLEDStatus = 0;

	private byte initClientLEDStatus = 0;
	private boolean kbdLEDSyncing = false;
	private String m_session_token;
	private int m_session_token_type = 0;
	private byte[] m_serverIP;
	private int m_serverPort;
	private int m_RedirectionState = REDIR_STOPPED;
	private boolean m_bUseSSL = false;
	private int m_cdPort;
	private int m_fdPort;
	private int m_hdPort;
	private int m_cdNum = 1;
	private int m_fdNum = 1;
	private int m_hdNum = 1;
	private int freeCDNum = 0;
	private int freeFDNum = 0;
	private int freeHDNum = 0;
	private int KVMCDNum = 0;
	private int KVMFDNum = 0;
	private int KVMHDNum = 0;
	private int m_cdStatus;
	private int m_fdStatus;
	private int m_hdStatus;
	private int selectedVMTab = 0;
	private boolean m_bVMUseSSL = false;

	private USBKeyboardRep m_USBKeyRep;
	private KeepAlive m_liveListener;
	private KeyProcessor keyprocessor = null;

	private ISOCApp soc_App;
	private ISOCFrameHdr socframeHdr;
	private static ISOCManager soc_manager;
	private JLabel label;
	private JDialog dialog;
	private VideoRecord m_videorecord;
	private Mousecaliberation Mousecaliberation;
	private String Message;
	private String serverIP;
	private SoftKeyboard softKeyboard;
	private AutoBWDlg m_autoBWDlg;
	public static byte WEB_PREVIEWER_CAPTURE_SUCCESS = 0;
	public static byte WEB_PREVIEWER_CAPTURE_FAILURE = -1;
	public static byte WEB_PREVIEWER_CAPTURE_IN_PROGRESS = -2;
	public static byte WEB_PREVIEWER_CONNECT_FAILURE = -3;
	public static byte WEB_PREVIEWER_INVALID_SERVERIP = -4;
	public static byte WEB_PREVIEWER_HOST_POWER_OFF = -5;
	public static byte WEB_PREVIEWER_INVALID_WEBPORT = -6;
	public static byte WEB_PREVIEWER_INVALID_WEBSECURE = -7;
	public static byte m_webPreviewer_cap_status = WEB_PREVIEWER_CAPTURE_IN_PROGRESS;
	private KVMShareDialog kVMDialog = null;
	private int m_zoomSliderValue;
	private boolean m_userPause = false;
	public static final int MAX_IMAGE_PATH_COUNT = 5;
	public static String[][] Imagepath_CD;
	public static String[][] Imagepath_Floppy;
	public static String[][] Imagepath_Harddsik;
	public static boolean showCursor = false;
	public static int REDIR_STOPPED = 0;
	public static int REDIR_STARTING = 1;
	public static int REDIR_STARTED = 2;
	public static int REDIR_STOPPING = 3;
	public static int REDIR_PAUSING = 4;
	public static final int NUMLOCK = 1;
	public static final int CAPSLOCK = 2;
	public static final int SCROLLLOCK = 4;
	public boolean m_refresh = false;
	private VMDialog vmDialog = null;
	public JDialog mediaDlg = null;

	public JVVideo vidClnt;

	public ISOCCreateBuffer prepare_buf;

	public static final byte OEM_FIT_TO_HOST_SCREEN = 1;

	public static final byte OEM_REDIR_RD_WR_MODE = 2;

	public static final byte OEM_SHOW_HOST_CURSOR_DEFAULT = 4;
	public static final byte OEM_SET_PHYSICAL_KBD_LANG = 8;
	public static final byte OEM_MD5_DIGEST_WEB_AUTH = 16;
	public static final byte KVM_RECONNECT_SUPPORT = 32;
	public static final byte OEM_JAVA_CD_IMAGE_REDIR = 64;
	public static final int OEM_KVM_MAX_DEVICE_COUNT = 128;
	public static final int OEM_SKIP_REPOSITIONING_JVIEWER_WINDOW = 256;
	public static final int OEM_SYNC_WITH_CLIENT_LED_STATUS = 512;
	public static final byte SERVER_POWER_ON = 1;
	public static final byte SERVER_POWER_OFF = 0;
	public static final byte HOST_DISPLAY_UNLOCK = 0;
	public static final byte HOST_DISPLAY_LOCK = 1;
	public static final byte HOST_DISPLAY_UNLOCKED_AND_DISABLED = 2;
	public static final byte HOST_DISPLAY_LOCKED_AND_DISABLED = 3;
	public static final int GET_MAC_ADDRESS = 1;
	public static final int COMPARE_MAC_ADDRESS = 2;
	public static final int VM_DISCONNECT = 0;
	public static final int VM_RECONNECT = 1;
	public static final int LEFT_FRAME_BORDER_SIZE = 8;
	private byte powerStatus;
	private StandAloneConnectionDialog connectionDialog;
	private SinglePortKVM singlePortKvm;
	private AutoKeyboardLayout autokeylayout = null;

	private String currentVersion = "2.113.0";
	private UserDefMacro userDefMacro = null;
	private AddMacro addMacro = null;
	private IPMICommandDialog ipmiDialog = null;
	private String zoomOption;
	private boolean fullKeyboardEnabled = false;
	private boolean fullPermissionRequest = false;
	private boolean renderFitToHost = true;
	private Hashtable<String, JDialog> responseDialogTable = null;
	public int currentSessionId = -1;
	private long lastPcktSent;
	private long lastPcktRecvd;
	private boolean sessionLive = false;
	private boolean retryConnection = false;
	public int currentRetryCount = 0;
	private int localport;
	private String resolutionStatus = null;
	private Dimension initialDimension = new Dimension(-1, -1);
	private Connection connection;
	private FrameRateTask frameRateTask = null;

	public static final int NonSSLService = 0;

	public static final int WebService = 1;

	public static final int KVMService = 2;

	public String VIDEO_RECORD_DEFAULT_PATH = System.getProperty("user.home");
	public int VIDEO_RECORD_DEFAULT_TIME = 20;
	private int resolutionChanged = -1;

	private int PRIV_LEVEL_NO_ACCESS = 15;
	private int PRIV_LEVEL_PROPRIETARY = 5;
	private int PRIV_LEVEL_ADMIN = 4;
	private int PRIV_LEVEL_OPERATOR = 3;
	private int PRIV_LEVEL_USER = 2;
	private int PRIV_LEVEL_CALLBACK = 1;
	private int PRIV_LEVEL_RESERVED = 0;
	private InfoDialog hidInitDialog = null;
	private static final byte SESSION_TYPE_VKVM = 5;

	public Object createObject(String paramString) {
		Object localObject = null;
		try {
			Class localClass = Class.forName(paramString);
			localObject = localClass.newInstance();
		} catch (InstantiationException localInstantiationException) {
			Debug.out.println(localInstantiationException);
		} catch (IllegalAccessException localIllegalAccessException) {
			Debug.out.println(localIllegalAccessException);
		} catch (ClassNotFoundException localClassNotFoundException) {
			Debug.out.println(localClassNotFoundException);
		}
		return localObject;
	}

	public static JViewerApp getInstance() {
		return m_rcApp;
	}

	private JViewerApp() {
		try {
			soc_manager = (ISOCManager) createObject("com.ami.kvm.jviewer.soc.SOCManager");
			oemManager = (IOEMManager) createObject("com.ami.kvm.jviewer.oem.OEMManager");
			this.prepare_buf = soc_manager.getSOCCreateBuffer();
			this.soc_App = soc_manager.getSOCApp();
			this.socframeHdr = soc_manager.getSOCFramehdr();
			this.connection = new Connection();
		} catch (NullPointerException e) {
			Debug.out.println(e);
			if (JViewer.isStandAloneApp()) {
				JOptionPane.showMessageDialog(this.m_frame, LocaleStrings.getString("D_1_JVAPP"),
						LocaleStrings.getString("D_2_JVAPP"), 0);
				JViewer.exit(0);
			}
		}

		this.m_view = new JViewerView(1600, 1200);

		if ((!JViewer.isStandAloneApp()) && (!JViewer.isWebPreviewer()) && (!JViewer.isBSODViewer())) {
			constructUI();
		}
	}

	public void constructUI() {
		this.m_wndFrame = new WindowFrame();
		if ((!JViewer.isplayerapp()) && (!JViewer.isdownloadapp())) {
			this.m_fsFrame = new FSFrame();
			this.m_USBKeyRep = this.m_view.getM_USBKeyRep();
			this.m_zoomSliderValue = 100;
			if (!JViewer.isVMediaEnabled()) {
				this.m_wndFrame.getWindowMenu().getMenuBar().remove(this.m_wndFrame.getWindowMenu().getMenu("Media"));

				this.m_fsFrame.getM_menuBar().remove(this.m_fsFrame.getM_menuBar().getFSMenu().getMenu("Media"));

				this.m_wndFrame.getToolbar().removeVMediaButtons();
			}
			if (!JViewer.isPowerPrivEnabled()) {
				this.m_wndFrame.getWindowMenu().getMenuBar().remove(this.m_wndFrame.getWindowMenu().getMenu("Power"));

				this.m_fsFrame.getM_menuBar().remove(this.m_fsFrame.getM_menuBar().getFSMenu().getMenu("Power"));
			}
		}
	}

	public JViewerView getRCView() {
		return this.m_view;
	}

	public KVMClient getKVMClient() {
		return this.m_KVMClnt;
	}

	public JVMenu getJVMenu() {
		if (this.m_wndMode) {
			return this.m_wndFrame.getMenu();
		}
		return this.m_fsFrame.getMenu();
	}

	public JVFrame getMainWindow() {
		if (this.m_wndMode) {
			return this.m_wndFrame;
		}
		return this.m_fsFrame;
	}

	public String getToken() {
		return this.m_encToken;
	}

	public String getSessionToken() {
		return this.m_session_token;
	}

	public int getSessionTokenType() {
		return this.m_session_token_type;
	}

	public void setStatus(String paramString) {
		this.m_frame.setStatus(paramString);
	}

	public void resetStatus() {
		this.m_frame.resetStatus();
	}

	public boolean isFullScreenMode() {
		return !this.m_wndMode;
	}

	public void refreshAppWndLabel() {
		try {
			this.m_frame.refreshTitle();
		} catch (Exception localException) {
			Debug.out.println("Not able to refresh the title");
			Debug.out.println(localException);
		}
	}

	public void setAppWndLabel(String paramString) {
		try {
			this.m_frame.setWndLabel(paramString);
		} catch (Exception localException) {
			Debug.out.println("Not able to set the Window Label");
			Debug.out.println(localException);
		}
	}

	public int GetRedirectionState() {
		return this.m_RedirectionState;
	}

	public void setRedirectionStatus(int paramInt) {
		this.m_RedirectionState = paramInt;
	}

	public byte getPowerStatus() {
		return this.powerStatus;
	}

	public void setPowerStatus(byte paramByte) {
		this.powerStatus = paramByte;
	}

	public void Ondisplayvideo(String paramString1, String paramString2, String paramString3, int paramInt) {
		this.m_frame = this.m_wndFrame;

		this.m_wndFrame.attachView();

		attachFrame();
		OnVideoRecordStartRedirection(paramString1, paramString2, paramString3, paramInt);
	}

	public void initilizeJVVideo() {
		this.vidClnt = new JVVideo();
		setVidClnt(this.vidClnt);

		this.sockvmclient.SetVidoclnt(this.vidClnt);
	}

	public void OnVideoRecordStartRedirection(String paramString1, String paramString2, String paramString3,
			int paramInt) {
		Debug.out.println("OnVideoRecordStartRedirection");
		this.m_RedirectionState = REDIR_STARTING;

		this.m_KVMClnt = new KVMClient(this.m_serverIP, this.m_serverPort, this.vidClnt, this.m_bUseSSL);
		this.sockvmclient = getSoc_manager().getSOCKvmClient();

		this.sockvmclient.SetKVMClient(this.m_KVMClnt);
		this.sockvmclient.SOCKVM_reader();
		initilizeJVVideo();

		if (JViewer.isdownloadapp()) {
			this.m_videorecord = new VideoRecord();
		}

		this.videorecordapp = new VideoRecordApp();

		JVFrame.setServerIP(this.m_serverIP, this.m_RedirectionState);

		if (-1 == this.videorecordapp.startVideorecordRedirection(paramString1, paramString2, paramInt, paramString3)) {
			getInstance().getM_frame().windowClosed();
		}
	}

	public void onLaunchStandAloneApp(String paramString1, int paramInt, String paramString2, String paramString3) {
		this.connectionDialog = new StandAloneConnectionDialog(null, paramString1, paramInt, paramString2,
				paramString3);
	}

	public StandAloneConnectionDialog getConnectionDialog() {
		return this.connectionDialog;
	}

	public void setConnectionDialog(StandAloneConnectionDialog paramStandAloneConnectionDialog) {
		this.connectionDialog = paramStandAloneConnectionDialog;
	}

	public SinglePortKVM getSinglePortKvm() {
		return this.singlePortKvm;
	}

	// ip, kvmPort, kvmToken, kvmTokenType, useSSL, VMUseSSL,
	// cdserver_port, fdserver_port, hdserver_port, Num_CD, Num_FD, Num_HD,
	// CD_State, FD_State, HD_State,
	// webSessionToken, webPort
	public void OnConnectToServer(String ip, int kvmPort, String kvmToken, int kvmTokenType, boolean useSSL,
			boolean VMUseSSL, int cdserver_port, int fdserver_port, int hdserver_port, byte Num_CD, byte Num_FD,
			byte Num_HD, int CD_State, int FD_State, int HD_State, String webSessionToken, int webPort) {
		this.m_serverIP = JViewer.getServerIP(ip);
		this.m_serverPort = kvmPort;
		this.m_encToken = kvmToken;
		this.m_session_token = kvmToken;
		this.m_session_token_type = kvmTokenType;
		this.m_frame = this.m_wndFrame;
		this.m_wndMode = true;
		this.m_bUseSSL = useSSL;
		if (JViewer.isSinglePortEnabled()) {
			this.singlePortKvm = new SinglePortKVM(ip, kvmPort, webPort, this.m_bUseSSL);
			this.singlePortKvm.startConnect();

		} else {
			this.m_cdPort = cdserver_port;
			this.m_fdPort = fdserver_port;
			this.m_hdPort = hdserver_port;
		}

		this.m_cdStatus = CD_State;
		this.m_fdStatus = FD_State;
		this.m_hdStatus = HD_State;
		this.m_bVMUseSSL = VMUseSSL;
		if ((JViewer.getOEMFeatureStatus() & 0x80) == 128L) {

			setFreeCDNum(JViewer.getKVM_Num_CD());
			setFreeFDNum(JViewer.getKVM_Num_FD());
			setFreeHDNum(JViewer.getKVM_Num_HD());
		} else {
			setFreeCDNum(Num_CD);
			setFreeFDNum(Num_FD);
			setFreeHDNum(Num_HD);
		}
		this.m_wndFrame.attachView();
		attachFrame();

		JVMenu localJVMenu = this.m_frame.getMenu();
		localJVMenu.notifyMenuStateEnable("VideoPauseRedirection", false);
		localJVMenu.notifyMenuStateEnable("VideoResumeRedirection", true);
		localJVMenu.notifyMenuStateSelected("VideoFullScreen", false);
		localJVMenu.notifyMenuStateEnable("Add Hotkeys", false);
		// MARK by tianlin for [视频开启入口]
		OnVideoStartRedirection();
		if ((JViewer.getOEMFeatureStatus() & 1L) == 1L) {
			setZoomOption("FitToHostResolution");
		}
	}

	public void OnConnectToServer(String paramString1, int paramInt1, int paramInt2, String paramString2,
			boolean paramBoolean, String paramString3) {
		this.m_serverIP = JViewer.getServerIP(paramString1);
		this.m_serverPort = paramInt1;
		this.m_encToken = paramString2;
		this.m_session_token = paramString2;
		this.m_bUseSSL = paramBoolean;
		if (JViewer.isSinglePortEnabled()) {
			this.singlePortKvm = new SinglePortKVM(paramString1, this.m_serverPort, paramInt2, paramBoolean);
			this.singlePortKvm.startConnect();
		}

		OnVideoStartRedirection();
	}

	public void OnConnectToServer(byte[] paramArrayOfByte) {
		this.m_serverIP = paramArrayOfByte;

		OnVideoStartRedirection();
	}

	private void attachFrame() {
		if (JViewer.isStandalone()) {
			if (!isM_wndMode()) {
				JViewer.getMainFrame().dispose();
				if (!JViewer.getMainFrame().isDisplayable()) {
					JViewer.getMainFrame().setUndecorated(true);
				}
				getMainWindow().m_viewSP.setHorizontalScrollBarPolicy(31);
				getMainWindow().m_viewSP.setVerticalScrollBarPolicy(21);
			} else if (!JViewer.getMainFrame().isDisplayable()) {
				JViewer.getMainFrame().setUndecorated(false);
			}
			JViewer.getMainFrame().setExtendedState(6);
			JViewer.getMainFrame().setContentPane(this.m_frame);

			Dimension localDimension = getCurrentMonitorResolution();
			JViewer.getMainFrame().setSize(localDimension.width, localDimension.height);
			JViewer.getMainFrame().setVisible(true);
			getInstance().getRCView().requestFocus();
		} else {
			JViewer.getMainPane().add(this.m_frame);
		}
	}

	private void detachFrame() {
		if (JViewer.isStandalone()) {
			JViewer.getMainFrame().getContentPane().remove(this.m_frame);
			JViewer.getMainFrame().dispose();
		}
	}

	public void OnVideoStartRedirection() {
		Debug.out.println("OnVideoStartRedirection");
		this.m_RedirectionState = REDIR_STARTING;
		if (this.currentRetryCount <= 0) {
			this.vidClnt = new JVVideo();
			setVidClnt(this.vidClnt);
		}
		this.m_KVMClnt = new KVMClient(this.m_serverIP, this.m_serverPort, this.vidClnt, this.m_bUseSSL);
		this.sockvmclient = getSoc_manager().getSOCKvmClient();
		if (this.currentRetryCount <= 0)
			this.sockvmclient.SetVidoclnt(this.vidClnt);
		this.sockvmclient.SetKVMClient(this.m_KVMClnt);
		this.sockvmclient.SOCKVM_reader();
		if ((!JViewer.isWebPreviewer()) && (!JViewer.isBSODViewer()) && (!this.m_KVMClnt.redirection())) {
			// MARK by tianlin for bebug ，真实环境放开
			// getInstance().getM_wndFrame().getToolbar().changeMacrowsStatus(false);
			// getInstance().getM_wndFrame().getM_status().enableStatusBar(false);
		}
		if (!JViewer.isBSODViewer()) {
			if ((JViewer.isKVMReconnectEnabled()) && ((JViewer.isjviewerapp()) || (JViewer.isStandAloneApp()))) {
				while (this.currentRetryCount <= JViewer.getRetryCount()) {
					if (-1 != this.m_KVMClnt.startRedirection())
						break;
					try {
						if (InfoDialog.getUndecDialog() == null) {
							InfoDialog.showDialog(JViewer.getMainFrame(), LocaleStrings.getString("D_64_JVAPP"), 4);
						}
						Thread.sleep(JViewer.getRetryInterval());
					} catch (InterruptedException localInterruptedException) {
						Debug.out.println(localInterruptedException);
					}
					this.currentRetryCount += 1;
				}

				if (this.currentRetryCount > JViewer.getRetryCount()) {
					Debug.out.println("Maximum number of retry to reconnect is reached");
					this.m_RedirectionState = REDIR_STOPPED;
					if ((!JViewer.isWebPreviewer()) && (!JViewer.isBSODViewer())) {
						JOptionPane.showMessageDialog(this.m_frame, LocaleStrings.getString("D_66_JVAPP"),
								LocaleStrings.getString("D_4_JVAPP"), 0);

						getInstance().getM_frame().windowClosed();
					} else {
						getInstance().setWebPreviewerCaptureStatus(WEB_PREVIEWER_CONNECT_FAILURE);
					}

				}

			} else if (-1 == this.m_KVMClnt.startRedirection()) {
				this.m_RedirectionState = REDIR_STOPPED;
				if ((!JViewer.isWebPreviewer()) && (!JViewer.isBSODViewer())) {
					JOptionPane.showMessageDialog(this.m_frame, LocaleStrings.getString("D_3_JVAPP"),
							LocaleStrings.getString("D_4_JVAPP"), 0);

					getInstance().getM_frame().windowClosed();
				} else {
					getInstance().setWebPreviewerCaptureStatus(WEB_PREVIEWER_CONNECT_FAILURE);
				}
			}
		}

		if ((!JViewer.isWebPreviewer()) && (!JViewer.isBSODViewer())) {

			JVFrame.setServerIP(this.m_serverIP, this.m_RedirectionState);

			if (JViewer.getKeyboardLayout().equalsIgnoreCase("AD"))
				onAutoKeyboardLayout(true, false);
			// TODO 到这里了
			this.m_view.addKeyListener();

			JVMenu localJVMenu = this.m_frame.getMenu();
			localJVMenu.notifyMenuStateEnable("VideoPauseRedirection", true);
			localJVMenu.notifyMenuStateEnable("VideoResumeRedirection", false);
			this.m_RedirectionState = REDIR_STARTED;
			if (!this.m_KVMClnt.redirection()) {
				String[] arrayOfString1 = { "VideoExit", "HelpAboutJViewer", "VideoFullScreen" };
				String[] arrayOfString2 = getExceptionMenuList(arrayOfString1);
				this.m_frame.getMenu().enableMenu(arrayOfString2, true, true);
				getInstance().getM_wndFrame().getToolbar().changeMacrowsStatus(false);
				getInstance().getM_wndFrame().getM_status().enableStatusBar(false);
			}

			this.m_frame.getMenu().SetMenuSelected("Locale" + JViewer.getLanguage(), Boolean.valueOf(true));

			if (this.m_userPause) {
				OnVideoPauseRedirection();
			}
		}
	}

	public void OnVideoStopRedirection() {
		Debug.out.println("OnVideoStopRedirection");
		if (this.m_RedirectionState == REDIR_STOPPED)
			return;
		this.m_RedirectionState = REDIR_STOPPING;
		this.m_KVMClnt.Stop_Cmd_Redirection();
		if ((JViewer.isjviewerapp()) || (JViewer.isStandAloneApp())) {
			JVFrame.setServerIP(null, this.m_RedirectionState);
			OnUSBMouseSyncCursor(false);

			this.m_frame.getMenu().notifyMenuStateEnable("VideoPauseRedirection", false);
			this.m_frame.getMenu().notifyMenuStateEnable("VideoResumeRedirection", true);

			if (isFullScreenMode()) {
				OnVideoFullScreen(false);
			}
		}
		if ((!JViewer.isdownloadapp()) && (!JViewer.isplayerapp())) {
			if ((JViewer.isSinglePortEnabled()) && (JViewer.isStandAloneApp()))
				getConnectionDialog().logoutWebSession();
			this.m_KVMClnt.stopRedirection();
			this.m_view.removeKMListener();
			this.m_RedirectionState = REDIR_STOPPED;
		}
	}

	public boolean isM_userPause() {
		return this.m_userPause;
	}

	public void setM_userPause(boolean paramBoolean) {
		this.m_userPause = paramBoolean;
	}

	private void changeMenuItemsStatusOnPauseResume(JVMenu paramJVMenu, boolean paramBoolean) {
		Set localSet = JVMenu.m_menuItems_setenabled.keySet();
		Iterator localIterator = localSet.iterator();

		while (localIterator.hasNext()) {
			String str = (String) localIterator.next();
			if (getOEMManager().getOEMJVMenu().oemchangeMenuItemsStatusOnPauseResume(str) != 1) {

				if ("VideoResumeRedirection" == str) {
					paramJVMenu.notifyMenuStateEnable(str, !paramBoolean);
				} else if (("VideoCaptureScreen" != str) && ("VideoFullScreen" != str) && ("VideoExit" != str)
						&& ("HelpAboutJViewer" != str) && (!str.startsWith("Locale"))) {

					if (("VideoRecordStart" == str) || ("VideoRecordSettings" == str) || ("VideoRecordStop" == str)) {

						if ((getInstance().getMainWindow().getMenu().getMenuItem("VideoRecordStop").isEnabled())
								&& (isM_userPause())) {
							getInstance().getM_videorecord().OnVideoRecordStop();
							InfoDialog.showDialog(this.m_frame, LocaleStrings.getString("D_5_JVAPP"),
									LocaleStrings.getString("D_6_JVAPP"), 2);

							paramJVMenu.notifyMenuStateEnable("VideoRecordStop", false);

						} else if ((!VideoRecord.Recording_Started) && (!VideoRecord.Record_Processing)) {

							if (("VideoRecordSettings" == str) && (getInstance().getMainWindow().getMenu()
									.getMenuItem("VideoRecordStart").isEnabled())) {
								paramJVMenu.notifyMenuStateEnable(str, paramBoolean);
							} else if ("VideoRecordSettings" == str) {
								paramJVMenu.notifyMenuStateEnable(str, paramBoolean);
							} else if (("VideoRecordStart" == str)
									&& (getInstance().getM_videorecord().getM_videoPath() != null)) {
								paramJVMenu.notifyMenuStateEnable(str, paramBoolean);
							}
						}
					} else if ("Calibrate Mouse Threshold" == str) {
						if (getInstance().getM_view().m_USBMouseMode == USBMouseRep.RELATIVE_MOUSE_MODE) {
							paramJVMenu.notifyMenuStateEnable(str, paramBoolean);
						} else {
							paramJVMenu.notifyMenuStateEnable(str, false);
						}

					} else if (("VideoHostDisplayUnlock" == str) || ("VideoHostDisplayLock" == str)) {
						if (paramBoolean) {
							changeHostDisplayLockStatus(getKVMClient().getHostLockStatus());
						} else {
							paramJVMenu.getMenuItem(str).setEnabled(paramBoolean);

						}

					} else if (("Power On Server" == str) && (this.powerStatus == 1)) {

						if (!paramBoolean) {
						}

					} else if (paramBoolean) {
						try {
							if ((paramJVMenu.getMenuItem(str) != null) && (paramJVMenu.getMenuEnable(str) != null))
								paramJVMenu.getMenuItem(str).setEnabled(paramJVMenu.getMenuEnable(str).booleanValue());
						} catch (Exception localException1) {
							Debug.out.println(localException1);
						}
					} else
						try {
							if (paramJVMenu.getMenuItem(str) != null)
								paramJVMenu.getMenuItem(str).setEnabled(paramBoolean);
						} catch (Exception localException2) {
							Debug.out.println(localException2);
						}
				}
			}
		}
		if (paramBoolean) {
			if (KVMSharing.KVM_REQ_GIVEN == 2) {
				OnChangeMenuState_KVMPartial(paramJVMenu, !paramBoolean);
			}
			getVidClnt().setZoomOptionStatus();
		}
	}

	public void OnVideoPauseRedirection() {
		if (this.m_RedirectionState != REDIR_STARTED) {
			return;
		}
		Debug.out.println("OnVideoPauseRedirection");
		this.m_RedirectionState = REDIR_PAUSING;
		this.m_KVMClnt.pauseRedirection();
		if ((!JViewer.isWebPreviewer()) || (!JViewer.isBSODViewer())) {
			JVFrame.setServerIP(null, this.m_RedirectionState);

			getInstance().refreshAppWndLabel();

			changeMenuItemsStatusOnPauseResume(this.m_frame.getMenu(), false);
			getInstance().getM_wndFrame().getToolbar().updatePlayPauseButton(true);

			getInstance().getM_wndFrame().getToolbar().changeMacrowsStatusOnPauseResume(false);
			if (getInstance().getSoftKeyboard() != null)
				getInstance().getSoftKeyboard().OnUpdateKeyState(Boolean.valueOf(false));
		}
		this.m_RedirectionState = REDIR_STOPPED;
	}

	public void OnVideoResumeRedirection() {
		Debug.out.println("OnVideoResume");

		this.m_RedirectionState = REDIR_STARTING;
		this.m_KVMClnt.resumeRedirection();
		if ((!JViewer.isWebPreviewer()) || (!JViewer.isBSODViewer())) {
			JVFrame.setServerIP(this.m_serverIP, this.m_RedirectionState);
			getInstance().refreshAppWndLabel();

			setM_userPause(false);
			changeMenuItemsStatusOnPauseResume(this.m_frame.getMenu(), true);

			if (this.m_view.GetUSBMouseMode() == USBMouseRep.RELATIVE_MOUSE_MODE) {
				this.m_view.mouseListener.splitandsend(-this.socframeHdr.getwidth(), -this.socframeHdr.getheight(),
						true);
			}

			getInstance().getM_wndFrame().getToolbar().updatePlayPauseButton(false);

			getInstance().getM_wndFrame().getToolbar().changeMacrowsStatusOnPauseResume(true);
			if (getInstance().getSoftKeyboard() != null)
				getInstance().getSoftKeyboard().OnUpdateKeyState(Boolean.valueOf(true));
		}
		this.m_RedirectionState = REDIR_STARTED;
	}

	public void OnVideoRefreshRedirection() {
		Debug.out.println("OnVideoRefresh");
		if ((JViewer.isjviewerapp()) || (JViewer.isStandAloneApp())) {
			if (this.m_RedirectionState == REDIR_STOPPED) {
				if (this.m_KVMClnt.m_isBlank == true) {
					OnVideoResumeRedirection();
					OnVideoPauseRedirection();
				} else {
					this.m_refresh = true;
					OnVideoResumeRedirection();
				}
			} else {
				OnVideoPauseRedirection();
				OnVideoResumeRedirection();
			}
		}
	}

	public void onVideoCaptureScreen() {
		BufferedImage localBufferedImage = null;

		if ((JViewer.isjviewerapp()) || (JViewer.isStandAloneApp())) {
			localBufferedImage = copyScreenBuffer(getInstance().getRCView().getImage());
		} else {
			localBufferedImage = copyScreenBuffer(getInstance().getPrepare_buf().getM_image());
		}
		CaptureScreen localCaptureScreen = new CaptureScreen(localBufferedImage);
		localCaptureScreen.start();
	}

	public BufferedImage copyScreenBuffer(BufferedImage paramBufferedImage) {
		ColorModel localColorModel = paramBufferedImage.getColorModel();
		boolean bool = paramBufferedImage.isAlphaPremultiplied();
		WritableRaster localWritableRaster = paramBufferedImage.copyData(null);
		return new BufferedImage(localColorModel, localWritableRaster, bool, null);
	}

	public void OnVideoFullScreen(boolean paramBoolean) {
		Debug.out.println("OnVideoFullScreen");
		HashMap localHashMap;
		if (this.m_wndMode) {
			this.m_wndFrame.detachView();
			detachFrame();
			this.m_frame = this.m_fsFrame;
			this.m_wndMode = false;
			this.m_fsFrame.attachView();
			attachFrame();
			this.m_fsFrame.showWindow();

			localHashMap = null;
			if (this.addMacro != null)
				localHashMap = getAddMacro().getMacroMap();
			if (localHashMap != null) {
				getAddMacro().removeMacroMenu();

				getAddMacro().addMacroMenu(localHashMap);
			}

			if (KVMSharing.KVM_REQ_GIVEN == 2)
				OnChangeMenuState_KVMPartial(this.m_fsFrame.getMenu(), false);
			this.m_frame.getMenu().notifyMenuStateEnable("FitToClientResolution", false);
			this.m_frame.getMenu().notifyMenuStateEnable("FitToHostResolution", false);
		} else {
			this.m_fsFrame.detachView();
			detachFrame();
			this.m_fsFrame.hideWindow();
			this.m_frame = this.m_wndFrame;
			this.m_wndMode = true;
			this.m_wndFrame.attachView();
			attachFrame();

			localHashMap = null;
			if (this.addMacro != null)
				localHashMap = getAddMacro().getMacroMap();
			if (localHashMap != null) {
				getAddMacro().removeMacroMenu();

				getAddMacro().addMacroMenu(localHashMap);
			}

			if ((KVMSharing.KVM_REQ_GIVEN == 2) && (!KVMShareDialog.isMasterSession)) {
				OnChangeMenuState_KVMPartial(this.m_wndFrame.getMenu(), false);
				getM_wndFrame().getToolbar().OnChangeToolbarIconState_KVMPartial();
			}

			if (getInstance().getRCView().GetUSBMouseMode() == USBMouseRep.OTHER_MOUSE_MODE) {
				GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
				JViewer.getMainFrame().setMaximizedBounds(localGraphicsEnvironment.getMaximumWindowBounds());
				JViewer.getMainFrame().setExtendedState(6);
			}
			getVidClnt().setZoomOptionStatus();

			onChangeZoomOptions("ActualSize");
			getJVMenu().notifyMenuStateSelected("ActualSize", true);
		}

		if (this.m_frame.getMenu().getMenuItem("VideoPauseRedirection").isEnabled()) {
			getInstance().setAppWndLabel("0 fps");
		}

		this.m_frame.getMenu().notifyMenuStateSelected("VideoFullScreen", paramBoolean);
		this.m_frame.getMenu().notifyMenuStateEnable("VideoFullScreen", true);
		this.m_frame.getMenu().refreshMenu();

		if ((this.userDefMacro != null) && (this.userDefMacro.isAddMacro())) {
			this.userDefMacro.onCloseDialog();
		}

		if (getInstance().getJVMenu().getMenuItem("Full Keyborad Support") != null) {
			getInstance().getJVMenu().getMenuItem("Full Keyborad Support").setSelected(isFullKeyboardEnabled());
			getInstance().getJVMenu().enableMenuAccelerator(isFullKeyboardEnabled());
			getInstance().getJVMenu().enableMenuMnemonics(isFullKeyboardEnabled());
		}
		getInstance().getJVMenu().updateUserMenu();
	}

	public void OnKeyboardHoldRightCtrlKey(boolean paramBoolean) {
		Debug.out.println("OnKeyboardHoldRightCtrlKey");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(17, 3, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);

		this.m_frame.getMenu().notifyMenuStateSelected("KeyboardHoldRightCtrlKey", paramBoolean);

		if (paramBoolean) {
			getM_wndFrame().getM_status().getRightCtrl().setForeground(Color.red);
		} else
			getM_wndFrame().getM_status().getRightCtrl().setForeground(Color.gray);
		getM_wndFrame().getM_status().getRightCtrl().setSelected(paramBoolean);

		if (getSoftKeyboard() != null) {
			getSoftKeyboard().syncHoldKey();
		}
	}

	public void OnKeyboardHoldRightAltKey(boolean paramBoolean) {
		Debug.out.println("OnKeyboardHoldRightAltKey");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(18, 3, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);

		this.m_frame.getMenu().notifyMenuStateSelected("KeyboardHoldRightAltKey", paramBoolean);

		if (paramBoolean) {
			getM_wndFrame().getM_status().getRightAlt().setForeground(Color.red);
		} else
			getM_wndFrame().getM_status().getRightAlt().setForeground(Color.gray);
		getM_wndFrame().getM_status().getRightAlt().setSelected(paramBoolean);

		if (getSoftKeyboard() != null) {
			getSoftKeyboard().syncHoldKey();
		}
	}

	public void OnKeyboardHoldLeftShiftKey(boolean paramBoolean) {
		Debug.out.println("OnKeyboardHoldLeftShiftKey");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(16, 2, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
	}

	public void OnKeyboardHoldRightShiftKey(boolean paramBoolean) {
		Debug.out.println("OnKeyboardHoldRightShiftKey");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(16, 3, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
	}

	public void OnKeyboardHoldLeftCtrlKey(boolean paramBoolean) {
		Debug.out.println("OnKeyboardHoldLeftCtrlKey");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(17, 2, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);

		this.m_frame.getMenu().notifyMenuStateSelected("KeyboardHoldLeftCtrlKey", paramBoolean);

		if (paramBoolean) {
			getM_wndFrame().getM_status().getLeftCtrl().setForeground(Color.red);
		} else
			getM_wndFrame().getM_status().getLeftCtrl().setForeground(Color.gray);
		getM_wndFrame().getM_status().getLeftCtrl().setSelected(paramBoolean);

		if (getSoftKeyboard() != null) {
			getSoftKeyboard().syncHoldKey();
		}
	}

	public void OnKeyboardHoldLeftAltKey(boolean paramBoolean) {
		Debug.out.println("OnKeyboardHoldLeftAltKey");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(18, 2, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);

		this.m_frame.getMenu().notifyMenuStateSelected("KeyboardHoldLeftAltKey", paramBoolean);

		if (paramBoolean) {
			getM_wndFrame().getM_status().getLeftAlt().setForeground(Color.red);
		} else
			getM_wndFrame().getM_status().getLeftAlt().setForeground(Color.gray);
		getM_wndFrame().getM_status().getLeftAlt().setSelected(paramBoolean);

		if (getSoftKeyboard() != null) {
			getSoftKeyboard().syncHoldKey();
		}
	}

	public void OnKeyboardLeftWindowsKeyHoldDown(boolean paramBoolean) {
		Debug.out.println("OnKeyboardLeftWindowsKeyHoldDown");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(524, 2, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);

		this.m_frame.getMenu().notifyMenuStateSelected("KeyboardLeftWindowsKeyHoldDown", paramBoolean);

		if (getSoftKeyboard() != null) {
			getSoftKeyboard().syncHoldKey();
		}
	}

	public void OnKeyboardLeftWindowsKeyPressRelease() {
		Debug.out.println("OnKeyboardLeftWindowsKeyPressRelease");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(524, 2, true);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(524, 2, false);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
	}

	public void OnKeyboardRightWindowsKeyHoldDown(boolean paramBoolean) {
		Debug.out.println("OnKeyboardRightWindowsKeyHoldDown");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(524, 3, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);

		this.m_frame.getMenu().notifyMenuStateSelected("KeyboardRightWindowsKeyHoldDown", paramBoolean);

		if (getSoftKeyboard() != null) {
			getSoftKeyboard().syncHoldKey();
		}
	}

	public void OnKeyboardRightWindowsKeyPressRelease() {
		Debug.out.println("OnKeyboardRightWindowsKeyPressRelease");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(524, 3, true);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(524, 3, false);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
	}

	public void OnKeyboardAltCtrlDel() {
		Debug.out.println("OnKeyboardAltCtrlDel");

		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(17, 2, true);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(18, 2, true);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(127, 1, true);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(127, 1, false);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(18, 2, false);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(17, 2, false);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
	}

	public void OnKeyboardContextMenu() {
		this.m_USBKeyRep.set(525, 1, true);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
		this.m_USBKeyRep.set(525, 1, false);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
	}

	public void resetModifiers() {
		byte b = USBKeyProcessorEnglish.getModifiers();
		if (((b & 0x1) == 1)
				&& (!getInstance().getJVMenu().getMenuSelected("KeyboardHoldLeftCtrlKey").booleanValue())) {
			getInstance().OnKeyboardHoldLeftCtrlKey(false);
		}
		if (((b & 0x10) == 16)
				&& (!getInstance().getJVMenu().getMenuSelected("KeyboardHoldRightCtrlKey").booleanValue())) {
			getInstance().OnKeyboardHoldRightCtrlKey(false);
		}
		if (((b & 0x4) == 4) && (!getInstance().getJVMenu().getMenuSelected("KeyboardHoldLeftAltKey").booleanValue())) {
			getInstance().OnKeyboardHoldLeftAltKey(false);
		}
		if (((b & 0x40) == 64)
				&& (!getInstance().getJVMenu().getMenuSelected("KeyboardHoldRightAltKey").booleanValue())) {
			getInstance().OnKeyboardHoldRightAltKey(false);
		}
		if ((b & 0x2) == 2) {
			getInstance().OnKeyboardHoldLeftShiftKey(false);
		}
		if ((b & 0x20) == 32) {
			getInstance().OnKeyboardHoldRightShiftKey(false);
		}
		USBKeyProcessorEnglish.setModifiers(b);
	}

	public void OnsendMacrokeycode(String paramString) {
		String[] arrayOfString = paramString.split("[+]");
		for (int i = 0; i < arrayOfString.length;) {
			int j = Integer.parseInt(arrayOfString[(i++)]);
			int k = Integer.parseInt(arrayOfString[(i++)]);
			sendKeyEvent(j, k, true);
		}
		int j;
		int k;
		for (int i = 0; i < arrayOfString.length;) {
			j = Integer.parseInt(arrayOfString[(i++)]);
			k = Integer.parseInt(arrayOfString[(i++)]);
			sendKeyEvent(j, k, false);
		}
	}

	public void sendKeyEvent(int paramInt1, int paramInt2, boolean paramBoolean) {
		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		this.m_USBKeyRep.set(paramInt1, paramInt2, paramBoolean);
		this.m_KVMClnt.sendKMMessage(this.m_USBKeyRep);
	}

	public void OnSkbrdDisplay(int paramInt) {
		if (this.softKeyboard != null) {
			this.softKeyboard.m_skmouselistener.close();
			this.softKeyboard.dispose();
		}
		if (paramInt == -1) {
			if (this.softKeyboard != null) {
				this.softKeyboard.setVisible(false);
				this.softKeyboard = null;
			}
		} else {
			this.softKeyboard = new SoftKeyboard(paramInt, JViewer.getMainFrame());

			if (this.powerStatus == 1) {
				this.softKeyboard.OnUpdateKeyState(Boolean.valueOf(true));
			} else {
				this.softKeyboard.OnUpdateKeyState(Boolean.valueOf(false));
			}
		}
	}

	public void OnEncryptionStatus() {
		if (!this.m_frame.getMenu().getMenuItem("OptionsKeyboardMouseEncryption").isEnabled()) {
			this.m_frame.getMenu().notifyMenuStateEnable("OptionsKeyboardMouseEncryption", true);
		}

		if (this.m_KVMClnt.isKMEncryptionEnabled()) {
			return;
		}

		this.m_KVMClnt.notifyEncryption(true);

		this.m_frame.getMenu().notifyMenuStateSelected("OptionsKeyboardMouseEncryption", true);
		if (KVMClient.DISABLE_ENCRPT_FLAG) {
			InfoDialog.showDialog(this.m_frame, LocaleStrings.getString("D_11_JVAPP"),
					LocaleStrings.getString("D_12_JVAPP"), 1);

			KVMClient.DISABLE_ENCRPT_FLAG = false;

			this.m_KVMClnt.getCrypt().initialize(this.m_encToken, 1);
		} else {
			InfoDialog.showDialog(this.m_frame, LocaleStrings.getString("D_13_JVAPP"),
					LocaleStrings.getString("D_12_JVAPP"), 1);
		}
	}

	public void OnInitialEncryptionStatus() {
		this.m_KVMClnt.notifyEncryption(true);

		this.m_frame.getMenu().notifyMenuStateSelected("OptionsKeyboardMouseEncryption", true);

		this.m_KVMClnt.getCrypt().initialize(this.m_encToken, 1);

		InfoDialog.showDialog(this.m_frame, LocaleStrings.getString("D_13_JVAPP"),
				LocaleStrings.getString("D_12_JVAPP"), 1);
	}

	public void OnOptionsKeyboardMouseEncryption(boolean paramBoolean) {
		Debug.out.println("OnOptionsKeyboardMouseEncryption");

		this.m_KVMClnt.setEncryption(paramBoolean);

		this.m_frame.getMenu().notifyMenuStateSelected("OptionsKeyboardMouseEncryption", paramBoolean);

		if (this.m_frame.getMenu().getMenuSelected("OptionsKeyboardMouseEncryption").booleanValue()) {
			this.m_frame.getMenu().notifyMenuStateEnable("OptionsKeyboardMouseEncryption", !paramBoolean);
		}

		if (true == paramBoolean) {
			this.m_KVMClnt.getCrypt().initialize(this.m_encToken, 1);
		} else {
			this.m_KVMClnt.getCrypt().close();
		}
	}

	public void OnUSBMouseSyncCursor(boolean paramBoolean) {
		Debug.out.println("OnUSBMouseSyncCursor");
		showCursor = true;
		this.m_view.USBsyncCursor(paramBoolean);
		this.m_frame.getMenu().refreshMenu();
	}

	public void OnShowCursor(boolean paramBoolean) {
		Debug.out.println("OnShowCursor");

		getJVMenu().notifyMenuStateEnable("MouseShowCursor", true);
		getJVMenu().notifyMenuStateSelected("MouseShowCursor", paramBoolean);
		URL localURL;
		if (paramBoolean) {
			if ((JVMenu.m_scale != 1.0D) || (this.zoomOption == "FitToClientResolution")) {
				if (this.m_view.GetUSBMouseMode() == USBMouseRep.RELATIVE_MOUSE_MODE) {
					showCursor = false;
					getJVMenu().notifyMenuStateSelected("MouseShowCursor", false);
					getJVMenu().notifyMenuStateEnable("MouseShowCursor", false);
					localURL = JViewer.class.getResource("res/Mouse2Btn-gray.png");
					getM_wndFrame().getToolbar().mouseBtn.setIcon(new ImageIcon(localURL));
					getInstance().getM_wndFrame().getToolbar().mouseBtn
							.setToolTipText(LocaleStrings.getString("D_48_JVAPP"));
				}
			} else {
				showCursor = true;
				this.m_view.ShowCursor(true);
				localURL = JViewer.class.getResource("res/Mouse2Btn.png");
				getM_wndFrame().getToolbar().mouseBtn.setIcon(new ImageIcon(localURL));
				getInstance().getM_wndFrame().getToolbar().mouseBtn
						.setToolTipText(LocaleStrings.getString("D_14_JVAPP"));
			}
		} else {
			showCursor = false;
			this.m_view.ShowCursor(false);
			localURL = JViewer.class.getResource("res/Mouse2Btn-gray.png");
			getM_wndFrame().getToolbar().mouseBtn.setIcon(new ImageIcon(localURL));
			if ((JVMenu.m_scale != 1.0D) || (this.zoomOption == "FitToClientResolution")) {
				if (this.m_view.GetUSBMouseMode() == USBMouseRep.RELATIVE_MOUSE_MODE) {
					getJVMenu().notifyMenuStateSelected("MouseShowCursor", false);
					getJVMenu().notifyMenuStateEnable("MouseShowCursor", false);
					getInstance().getM_wndFrame().getToolbar().mouseBtn
							.setToolTipText(LocaleStrings.getString("D_48_JVAPP"));
				}
			} else {
				getInstance().getM_wndFrame().getToolbar().mouseBtn
						.setToolTipText(LocaleStrings.getString("D_15_JVAPP"));
			}
		}
	}

	public void OnOptionsBandwidthAutoDetect() {
		Debug.out.println("OnOptionsBandwidthAutoDetect");
		this.m_KVMClnt.autoDetect();

		if (JViewer.isStandalone()) {
			this.m_autoBWDlg = new AutoBWDlg(JViewer.getMainFrame());
			this.m_autoBWDlg.setVisible(true);
			this.m_autoBWDlg.setLocation(getInstance().getPopUpWindowPosition(300, 100));
		} else {
			JPanel localJPanel = new JPanel();
			this.label = new JLabel(LocaleStrings.getString("9_1_BW") + " ...");
			localJPanel.add(this.label);
			JOptionPane localJOptionPane = new JOptionPane(localJPanel, -1);
			localJOptionPane.setOptions(new Object[0]);
			this.dialog = localJOptionPane.createDialog(getInstance().getMainWindow(),
					LocaleStrings.getString("9_1_BW") + "...");
			this.dialog.setResizable(false);
			this.dialog.setSize(300, 100);
			this.dialog.setLocation(getInstance().getPopUpWindowPosition(300, 100));
			this.dialog.setVisible(true);
		}
	}

	public void updateBandwidthMsg(String paramString) {
		if (JViewer.isStandalone()) {
			if ((this.m_autoBWDlg != null) && (this.m_autoBWDlg.isVisible())) {
				this.m_autoBWDlg.setMessage(LocaleStrings.getString("9_1_BW") + " - " + paramString);
			}

			this.m_autoBWDlg.done();
		} else {
			try {
				this.label.setText(LocaleStrings.getString("9_1_BW") + " - " + paramString);
				Thread.sleep(1000L);
				this.label.setText(LocaleStrings.getString("9_3_BW") + "...");
				Thread.sleep(1000L);
				this.label.setText(
						LocaleStrings.getString("D_16_JVAPP") + paramString + LocaleStrings.getString("D_17_JVAPP"));
				Thread.sleep(1000L);
				this.dialog.dispose();
			} catch (Exception localException) {
				Debug.out.println(localException);
			}
		}
	}

	public void OnOptionsBandwidth(int paramInt) {
		this.m_KVMClnt.setBandwidth(paramInt);
		this.m_frame.getMenu().SetMenuSelected(JVMenu.previous_bandwidth, Boolean.valueOf(false));

		switch (paramInt) {
		case 32768:
			Debug.out.println("OnOptionsBandwidth256Kbps");
			JVMenu.previous_bandwidth = "OptionsBandwidth256Kbps";
			this.m_frame.getMenu().notifyMenuStateSelected("OptionsBandwidth256Kbps", true);
			break;
		case 65536:
			Debug.out.println("OnOptionsBandwidth512Kbps");
			JVMenu.previous_bandwidth = "OptionsBandwidth512Kbps";
			this.m_frame.getMenu().notifyMenuStateSelected("OptionsBandwidth512Kbps", true);
			break;
		case 131072:
			Debug.out.println("OnOptionsBandwidth1Mbps");
			JVMenu.previous_bandwidth = "OptionsBandwidth1Mbps";
			this.m_frame.getMenu().notifyMenuStateSelected("OptionsBandwidth1Mbps", true);
			break;
		case 1310720:
			Debug.out.println("OnOptionsBandwidth10Mbps");
			JVMenu.previous_bandwidth = "OptionsBandwidth10Mbps";
			this.m_frame.getMenu().notifyMenuStateSelected("OptionsBandwidth10Mbps", true);
			break;
		case 13107200:
			Debug.out.println("OnOptionsBandwidth100Mbps");
			JVMenu.previous_bandwidth = "OptionsBandwidth100Mbps";
			this.m_frame.getMenu().notifyMenuStateSelected("OptionsBandwidth100Mbps", true);
		}

	}

	public void invokeIPMICommandDialog() {
		this.ipmiDialog = new IPMICommandDialog(JViewer.getMainFrame());
		this.ipmiDialog.showDialog();
	}

	public IPMICommandDialog getIPMIDialog() {
		return this.ipmiDialog;
	}

	public void setIPMIDialog(IPMICommandDialog paramIPMICommandDialog) {
		this.ipmiDialog = paramIPMICommandDialog;
	}

	public int onSendIPMICommand(byte paramByte, byte[] paramArrayOfByte) {
		IVTPPktHdr localIVTPPktHdr = new IVTPPktHdr((short) 48, paramArrayOfByte.length + 1, (short) 0);
		ByteBuffer localByteBuffer = ByteBuffer.allocate(localIVTPPktHdr.size() + paramArrayOfByte.length + 1);

		localByteBuffer.position(0);
		localByteBuffer.put(localIVTPPktHdr.array());
		localByteBuffer.put(paramByte);
		localByteBuffer.put(paramArrayOfByte);
		localByteBuffer.position(0);
		byte[] arrayOfByte = new byte[localByteBuffer.limit()];
		localByteBuffer.get(arrayOfByte, 0, localByteBuffer.limit());
		if (arrayOfByte.length != getKVMClient().sendMessage(arrayOfByte, arrayOfByte.length)) {
			Debug.out.println("Failed to send IPMI command");
			return -1;
		}
		return 0;
	}

	public void onGetIPMICommandResponse(ByteBuffer paramByteBuffer, int paramInt) {
		String str1 = new String();
		byte b = 0;
		paramByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
		b = paramByteBuffer.get();
		if (paramInt == 0) {
			byte[] tianlin = new byte[paramByteBuffer.limit() - 1];
			paramByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
			paramByteBuffer.position(1);
			paramByteBuffer.get((byte[]) tianlin);

			str1 = Debug.out.dumpIPMI((byte[]) tianlin, 0, tianlin.length);
			if ((str1.equals("")) || (str1.length() == 0)) {
				String str2 = Integer.toHexString(paramInt & 0xFF);
				str1 = LocaleStrings.getString("D_50_JVAPP") + " : 0x " + str2.toUpperCase();
			}
		} else {
			String tianlin = Integer.toHexString(paramInt & 0xFF);
			str1 = LocaleStrings.getString("D_50_JVAPP") + " : 0x " + ((String) tianlin).toUpperCase();
		}

		this.ipmiDialog.onIPMICommandRespose(b, str1);
	}

	public void OnGUILanguageChange(String paramString) {
		JViewer.setLanguage(paramString);
		Locale localLocale = new Locale(paramString.toLowerCase());
		JComponent.setDefaultLocale(localLocale);
		getJVMenu().changeMenuLanguage();
		getJVMenu().changeMenuItemLanguage();
		getJVMenu().changeStatusBarLanguage();
		getInstance().getM_wndFrame().getToolbar().changeToolBarItemLanguage();
		getInstance().getM_wndFrame().getToolbar()
				.setZoomLabel(getM_wndFrame().getToolbar().getSlider_zoom().getValue());
		getInstance().getRCView().repaint();
		if (this.ipmiDialog != null) {
			this.ipmiDialog.closeIPMICommandDialog();
			this.ipmiDialog = null;
			invokeIPMICommandDialog();
		}
		if (getVMDialog() != null) {
			this.vmDialog.reInitialize();
		}
	}

	public void onSendFullPermissionRequest() {
		KVMSharing.KVM_CLIENT_USERNAME = null;
		KVMSharing.KVM_CLIENT_IP = null;
		KVMSharing.KVM_CLIENT_SESSION_INDEX = null;
		KVMSharing.KVM_CLIENT_IPMI_PRIV = 0;
		if (getKVMClient().sendKVMFullPermissionRequest() < 0) {
			InfoDialog.showDialog(this.m_frame, LocaleStrings.getString("D_53_JVAPP"),
					LocaleStrings.getString("D_54_JVAPP"), 2);
		}
	}

	public void onGetFullPermissionRequest(short paramShort) {
		this.fullPermissionRequest = true;
		OnKvmPrevilage(paramShort);
	}

	public void onSendKeepAliveRequest() {
		if (getKVMClient().sendKeepAliveRequest() < 0) {
			getInstance().onReconnect();
		}
	}

	public Point getWindowPostionToSet() {
		Point localPoint1 = getOEMManager().getWindowPosition();

		if (localPoint1 != null) {
			return localPoint1;
		}

		if ((JViewer.getOEMFeatureStatus() & 0x100) == 256L) {
			return JViewer.getMainFrame().getLocationOnScreen();
		}

		JFrame localJFrame = JViewer.getMainFrame();
		Point localPoint2 = new Point();
		int i = 0;
		int j = 0;

		GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice[] arrayOfGraphicsDevice1 = localGraphicsEnvironment.getScreenDevices();

		for (GraphicsDevice localGraphicsDevice : arrayOfGraphicsDevice1) {
			DisplayMode localDisplayMode = localGraphicsDevice.getDisplayMode();

			if (localDisplayMode != null) {
				localPoint2.x = localDisplayMode.getWidth();
				localPoint2.y = localDisplayMode.getHeight();
			}

			i += localPoint2.x;
			if ((localJFrame.isShowing()) && (localJFrame.getLocationOnScreen().x < i)) {
				break;
			}
			j = localPoint2.x + 1;
		}

		localPoint2.x = j;

		localPoint2.y = 0;
		return localPoint2;
	}

	public Point getPopUpWindowPosition(int paramInt1, int paramInt2) {
		JFrame localJFrame = null;
		int i = 0;
		int j = 0;

		localJFrame = JViewer.getMainFrame();
		int k = localJFrame.getLocationOnScreen().x;
		int m = localJFrame.getLocationOnScreen().y;
		Dimension localDimension = Toolkit.getDefaultToolkit().getScreenSize();

		i = k + (localJFrame.getWidth() - paramInt1) / 2;
		j = m > localDimension.height ? m + (localJFrame.getHeight() - paramInt2) / 2
				: (m + localJFrame.getHeight() - paramInt2) / 2;
		Point localPoint = new Point(i, j);

		return localPoint;
	}

	public Dimension getCurrentMonitorResolution() {
		JFrame localJFrame = JViewer.getMainFrame();
		Dimension localDimension = new Dimension();
		int i = 0;
		GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice[] arrayOfGraphicsDevice1 = localGraphicsEnvironment.getScreenDevices();

		for (GraphicsDevice localGraphicsDevice : arrayOfGraphicsDevice1) {
			DisplayMode localDisplayMode = localGraphicsDevice.getDisplayMode();

			if (localDisplayMode != null) {
				localDimension.width = localDisplayMode.getWidth();
				localDimension.height = localDisplayMode.getHeight();
			}

			i += localDimension.width;

			if ((localJFrame.isShowing()) && (localJFrame.getLocationOnScreen().x + 8 < i)) {
				break;
			}
		}

		this.initialDimension.setSize(localDimension.width, localDimension.height);
		return localDimension;
	}

	public void OnHelpAboutJViewer() {
		Debug.out.println("OnHelpAboutJViewer");
		OEMResourceURLProcessor localOEMResourceURLProcessor = new OEMResourceURLProcessor(getM_webSession_token(),
				JViewer.getIp());
		String str1 = localOEMResourceURLProcessor.getOemCopyright();
		ImageIcon localImageIcon = localOEMResourceURLProcessor.getOemLogo();
		if ((str1 != null) && (str1.length() > 0)) {
			String str2 = "<=socversion=>";
			if (str1.contains(str2)) {
				str1 = str1.replace(str2, getSoc_manager().getSOCVersion());
			}
			str2 = "<=soc=>";
			if (str1.contains(str2)) {
				str1 = str1.replace(str2, getSoc_manager().getSOC());
			}
			str2 = "<=jviewerversion=>";
			if (str1.contains(str2)) {
				str1 = str1.replace(str2, this.currentVersion);
			}
		} else {
			str1 = LocaleStrings.getString("D_18_JVAPP") + this.currentVersion + "\n"
					+ LocaleStrings.getString("D_19_JVAPP") + getSoc_manager().getSOCVersion()
					+ LocaleStrings.getString("D_20_JVAPP") + getSoc_manager().getSOC() + "\n"
					+ LocaleStrings.getString("D_21_JVAPP");
		}

		if (localImageIcon == null) {
			localImageIcon = new ImageIcon(JViewer.class.getResource("res/ami.jpg"));
		}
		JOptionPane.showMessageDialog(this.m_frame, str1, LocaleStrings.getString("D_22_JVAPP") + JViewer.getTitle(), 1,
				localImageIcon);
	}

	public void OnTerminateActiveuser(int paramInt) {
		int i = KVMClient.getNumUsers();
		if (paramInt >= i) {
			return;
		}
		String[] arrayOfString = KVMClient.getUserData();
		String str = arrayOfString[paramInt].substring(0, arrayOfString[paramInt].indexOf(":") - 1).trim();
		int j = Integer.parseInt(str);
		if (j == getInstance().getCurrentSessionId()) {
			return;
		}
		getKVMClient().SendKillSession((byte) 5, j);
	}

	public void OnVideoExit() {
		Debug.out.println("OnVideoExit");
		this.m_frame.exitApp();
	}

	public void onMaxSession() {
		JOptionPane.showMessageDialog(this.m_frame, LocaleStrings.getString("D_23_JVAPP"),
				LocaleStrings.getString("D_24_JVAPP"), 1);

		this.m_frame.exitApp();
	}

	public void OnGetMouseMode(byte paramByte) {
		Debug.out.println("Mouse mode response packet received. Mouse Mode:" + paramByte);
		this.m_view.SetUSBMouseMode(paramByte);

		OnUSBMouseSyncCursor(true);
		if (paramByte == USBMouseRep.RELATIVE_MOUSE_MODE) {
			getInstance().getJVMenu().notifyMenuStateEnable("Calibrate Mouse Threshold", true);
			getInstance().getJVMenu().notifyMenuStateSelected("Relative", true);

			if ((!JViewer.getMainFrame().isResizable()) && (!isFullScreenMode()) && (this.zoomOption == "ActualSize")) {
				JViewer.getMainFrame().setResizable(true);
				getInstance().getMainWindow().m_viewSP.setHorizontalScrollBarPolicy(30);
				getInstance().getMainWindow().m_viewSP.setVerticalScrollBarPolicy(20);
			}
		} else if (paramByte == USBMouseRep.OTHER_MOUSE_MODE) {
			GraphicsConfiguration localGraphicsConfiguration = getInstance().getM_wndFrame().getGraphicsConfiguration();
			Dimension localDimension = getCurrentMonitorResolution();
			Insets localInsets = Toolkit.getDefaultToolkit().getScreenInsets(localGraphicsConfiguration);
			int i = localDimension.height;
			int j = localDimension.width;
			int k = localInsets.top + localInsets.bottom;
			int m = localInsets.left + localInsets.right;
			int n = i - k;
			int i1 = j - m;
			getInstance().getJVMenu().notifyMenuStateSelected("Other", true);

			JViewer.getMainFrame().setLocation(getWindowPostionToSet());

			getInstance().getMainWindow().m_viewSP.setHorizontalScrollBarPolicy(31);
			getInstance().getMainWindow().m_viewSP.setVerticalScrollBarPolicy(21);
			GraphicsEnvironment localGraphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
			JViewer.getMainFrame().setMaximizedBounds(localGraphicsEnvironment.getMaximumWindowBounds());
			JViewer.getMainFrame().setSize(i1, n);
			JViewer.getMainFrame().setResizable(false);
			getInstance().OnShowCursor(false);
			getInstance().getJVMenu().notifyMenuStateSelected("MouseShowCursor", false);
			InfoDialog.showDialog(JViewer.getMainFrame(),
					LocaleStrings.getString("E_7_JVIEW") + LocaleStrings.getString("E_3_JVIEW"),
					LocaleStrings.getString("F_46_JVM"), 1);

		} else if (paramByte == USBMouseRep.ABSOLUTE_MOUSE_MODE) {
			if ((!JViewer.getMainFrame().isResizable()) && (!isFullScreenMode()) && (this.zoomOption == "ActualSize")) {
				JViewer.getMainFrame().setResizable(true);
				getInstance().getMainWindow().m_viewSP.setHorizontalScrollBarPolicy(30);
				getInstance().getMainWindow().m_viewSP.setVerticalScrollBarPolicy(20);
			}
			getInstance().getJVMenu().notifyMenuStateSelected("Absolute", true);
			getInstance().OnShowCursor(true);
			getInstance().getJVMenu().notifyMenuStateSelected("MouseShowCursor", true);
		}
		getVidClnt().setZoomOptionStatus();
		getM_wndFrame().getM_status().resetStatus();
		getInstance().getJVMenu().notifyMouseMode(paramByte);
	}

	public void OnValidateVideoSessionResp(byte paramByte1, byte paramByte2) {
		Debug.out.println("OnValidateVideoSessionResp");
		if (paramByte1 == 0) {
			this.m_frame.generalErrorMessage(LocaleStrings.getString("D_25_JVAPP"),
					LocaleStrings.getString("D_26_JVAPP"));

			JViewer.exit(0);
		} else if (paramByte1 == 2) {
			this.m_frame.generalErrorMessage(LocaleStrings.getString("D_25_JVAPP"),
					LocaleStrings.getString("1_5_JVIEWER"));

			JViewer.exit(0);
		} else if (paramByte1 == 3) {
			this.m_frame.generalErrorMessage(LocaleStrings.getString("D_25_JVAPP"),
					LocaleStrings.getString("D_65_JVAPP"));

			JViewer.exit(0);
		}

		if ((JViewer.isKVMReconnectEnabled()) && ((JViewer.isjviewerapp()) || (JViewer.isStandAloneApp()))) {
			if (getRetryConnection()) {
				InfoDialog.undecDialogClose();
			} else {
				InfoDialog.undecDialogClose();

				if (JViewer.isPowerSaveModeEnabled()) {
					getInstance().getRCView().removeKMListener();
					this.hidInitDialog = InfoDialog.showDialog(JViewer.getMainFrame(),
							LocaleStrings.getString("D_69_JVAPP"), 5000L, 5);
				}
			}

			setSessionLive(true);
			this.m_liveListener = new KeepAlive();
			this.m_liveListener.start();
			this.currentRetryCount = 0;

			if (!this.m_userPause) {
				getInstance().OnVideoRefreshRedirection();
			}
			setRetryConnection(false);
		}

		this.m_KVMClnt.setSocketTimeout();

		this.currentSessionId = paramByte2;

		this.m_KVMClnt.OnValidVideoSession();
		Object localObject1;
		Object localObject2;
		if ((!JViewer.isWebPreviewer()) && (this.m_KVMClnt.redirection())) {
			localObject1 = new String[] { "VideoExit", "HelpAboutJViewer", "VideoFullScreen" };
			localObject2 = getExceptionMenuList((String[]) localObject1);
			this.m_frame.getMenu().enableMenu((String[]) localObject2, true, true);
			if (KVMSharing.KVM_REQ_GIVEN == 2) {
				getInstance().getJVMenu().notifyMenuStateEnable("OptionsKeyboardMouseEncryption", false);
			} else {
				getInstance().getM_wndFrame().getM_status().enableStatusBar(true);
			}

			getInstance().getM_wndFrame().getToolbar().changeMacrowsStatus(true);

			if (this.m_userPause) {
				this.m_RedirectionState = REDIR_STARTED;
				OnVideoPauseRedirection();
			}
		}

		if (JViewer.isjviewerapp()) {

			localObject1 = getInstance().getM_webSession_token();
			localObject2 = new byte[((String) localObject1).length()];
			localObject2 = ((String) localObject1).getBytes();
			Debug.out.dump((byte[]) localObject2);
			IVTPPktHdr localIVTPPktHdr = new IVTPPktHdr((short) 21, ((byte[]) localObject2).length, (short) 0);
			ByteBuffer localByteBuffer = ByteBuffer.allocate(localIVTPPktHdr.size() + ((byte[]) localObject2).length);
			localByteBuffer.position(0);
			localByteBuffer.put(localIVTPPktHdr.array());
			localByteBuffer.put((byte[]) localObject2);
			localByteBuffer.position(0);
			byte[] arrayOfByte = new byte[localByteBuffer.limit()];
			localByteBuffer.get(arrayOfByte);

			if (arrayOfByte.length != getKVMClient().sendMessage(arrayOfByte, arrayOfByte.length)) {
				Debug.out.println("Failed to web Session token to the card");
				return;
			}
		}
	}

	public void onKeybdLED(byte paramByte) {
		if (getClientKeyboardLEDStatus() != paramByte) {
			if ((!JViewerView.syncLEDFlag) || (this.powerStatus == 0)) {

				try {

					if ((JViewer.getOEMFeatureStatus() & 0x200) != 512L) {
						setClientKeyboardLEDStatus(paramByte);
					}
				} catch (Exception localException) {
					Debug.out.println(localException);
				}
			}
			setHostKeyboardLEDStatus(paramByte);
			if (getSoftKeyboard() != null) {
				getSoftKeyboard().syncKbdLED();
			}
			if ((JViewer.getOEMFeatureStatus() & 0x200) == 512L) {
				if ((this.frameRateTask != null) && (!isKbdLEDSyncing())) {
					this.frameRateTask.setSyncLEDFromClient(true);
				}
			}
		}
	}

	public void resetLEDStatus() {
		if ((JViewer.getOEMFeatureStatus() & 0x200) != 512L) {
			setClientKeyboardLEDStatus((byte) 0);
			setHostKeyboardLEDStatus((byte) 0);
		}
	}

	public byte getHostKeyboardLEDStatus() {
		return this.hostLEDStatus;
	}

	public void setHostKeyboardLEDStatus(byte paramByte) {
		this.hostLEDStatus = paramByte;
	}

	public byte getClientKeyboardLEDStatus() {
		FloppyRedir localFloppyRedir = new FloppyRedir(true);
		this.clientLEDStatus = localFloppyRedir.ReadKeybdLEDStatus();
		localFloppyRedir = null;
		return this.clientLEDStatus;
	}

	public void setClientKeyboardLEDStatus(byte paramByte) {
		try {
			if ((!Mousecaliberation.THRESHOLDFLAG) && (!Mousecaliberation.ACCELERATION_FLAG)) {
				this.m_view.removeKeyListener();
			}

			if (!isMacClient()) {
				if (this.frameRateTask != null) {
					this.frameRateTask.updateKeyboardLEDStatus(paramByte);
				} else {
					FloppyRedir localFloppyRedir = new FloppyRedir(true);
					try {
						localFloppyRedir.setKeyboardLEDStatus(paramByte);
					} catch (Exception localException2) {
						Debug.out.println(localException2);
					} finally {
						localFloppyRedir = null;
					}
				}
				Thread.sleep(1000L);
			}
			if ((!Mousecaliberation.THRESHOLDFLAG) && (!Mousecaliberation.ACCELERATION_FLAG)) {
				this.m_view.addKeyListener();
			}
			if (getSoftKeyboard() != null)
				getSoftKeyboard().syncKbdLED();
		} catch (Exception localException1) {
			Debug.out.println(localException1);
		}
	}

	public byte getInitClientLEDStatus() {
		return this.initClientLEDStatus;
	}

	public void setInitClientLEDStatus(byte paramByte) {
		this.initClientLEDStatus = paramByte;
	}

	public void sendClientLEDStatus() {
		byte b1 = getClientKeyboardLEDStatus();
		byte b2 = getHostKeyboardLEDStatus();
		int i = 0;
		int j = 1;

		try {
			setKbdLEDSyncing(true);
			if (b2 != b1) {
				if ((b1 & 0x1) != (b2 & 0x1)) {
					i = 144;
					j = 4;
					sendKeyEvent(i, j, true);
					sendKeyEvent(i, j, false);
				}

				Thread.sleep(100L);

				if ((b1 & 0x2) != (b2 & 0x2)) {
					i = 20;
					j = 1;
					sendKeyEvent(i, j, true);
					sendKeyEvent(i, j, false);
				}
				Thread.sleep(100L);

				if ((b1 & 0x4) != (b2 & 0x4)) {
					i = 145;
					j = 1;
					sendKeyEvent(i, j, true);
					sendKeyEvent(i, j, false);
				}
				Thread.sleep(100L);
				setHostKeyboardLEDStatus(b1);
			}
		} catch (InterruptedException localInterruptedException) {
			Debug.out.println(localInterruptedException);
		} catch (Exception localException) {
			Debug.out.println(localException);
		}
		setKbdLEDSyncing(false);
	}

	public boolean isKbdLEDSyncing() {
		return this.kbdLEDSyncing;
	}

	public void setKbdLEDSyncing(boolean paramBoolean) {
		this.kbdLEDSyncing = paramBoolean;
	}

	public void stopRedirection_ISoImage() {
		int i = 0;
		int j = 0;
		int k = 0;
		IUSBRedirSession localIUSBRedirSession = VMApp.getInstance().getIUSBRedirSession();

		i = VMApp.getInstance().getNumCD();
		j = VMApp.getInstance().getNumFD();
		k = VMApp.getInstance().getNumHD();
		int m;
		if (localIUSBRedirSession.cdromSession != null) {
			for (m = 0; m < i; m++) {
				if ((VMApp.getInstance().getIUSBRedirSession().cdromSession[m].isCdImageRedirected())
						&& (localIUSBRedirSession.cdromSession[m].isCdImageEjected())) {
					localIUSBRedirSession.StopISORedir(m, 1);
				}
			}
		}
		if (localIUSBRedirSession.floppySession != null) {
			for (m = 0; m < j; m++) {
				if ((VMApp.getInstance().getIUSBRedirSession().floppySession[m].isFdImageRedirected())
						&& (VMApp.getInstance().getIUSBRedirSession().floppySession[m].isFdImageEjected())) {
					localIUSBRedirSession.StopFloppyImageRedir(m, 1);
				}
			}
		}
		if (localIUSBRedirSession.hardDiskSession != null) {
			for (m = 0; m < k; m++) {
				if ((VMApp.getInstance().getIUSBRedirSession().hardDiskSession[m].isHdImageRedirected())
						&& (VMApp.getInstance().getIUSBRedirSession().hardDiskSession[m].isHdImageEjected())) {
					localIUSBRedirSession.StopHarddiskImageRedir(m, 1);
				}
			}
		}
	}

	public void OnCalibareteMouse(boolean paramBoolean) {
		if (JVMenu.m_scale != 1.0D) {
			JOptionPane.showMessageDialog(getM_frame(), LocaleStrings.getString("D_27_JVAPP"),
					LocaleStrings.getString("D_28_JVAPP"), 0);

			getJVMenu().notifyMenuStateSelected("Calibrate Mouse Threshold", false);
			return;
		}
		Mousecaliberation.resetCursor();
		if (this.Mousecaliberation == null) {
			this.Mousecaliberation = new Mousecaliberation();
		}
		getInstance().getJVMenu().notifyMenuStateEnable("VideoFullScreen", false);
		getInstance().getM_wndFrame().getToolbar().getFullScreenBtn()
				.setToolTipText(LocaleStrings.getString("D_29_JVAPP"));

		getJVMenu().notifyMenuStateSelected("Calibrate Mouse Threshold", true);

		getInstance().getRCView().removeKMListener();
		this.Mousecaliberation.OnCalibareteMouseThreshold(paramBoolean);
	}

	public void OnSendKVMPrevilage(byte paramByte, String paramString) {
		if ((paramByte == 0) && ((getInstance().IsCDROMRedirRunning()) || (getInstance().IsFloppyRedirRunning())
				|| (getInstance().IsHarddiskRedirRunning()))) {

			if (!getM_frame().stopVMediaRedirection(LocaleStrings.getString("D_58_JVAPP"))) {
				paramByte = 2;
			}
		}

		this.m_KVMClnt.SendKVMPrevilage(paramByte, paramString);
		if (isFullPermissionRequest()) {
			setFullPermissionRequest(false);
		}
	}

	public void onStopConcurrentSession() {
		if (KVMSharing.KVM_REQ_GIVEN == 2) {
			InfoDialog.showDialog(JViewer.getMainFrame(), LocaleStrings.getString("D_51_JVAPP"),
					LocaleStrings.getString("D_52_JVAPP"), 1);
		}

		KVMSharing.KVM_REQ_GIVEN = 1;
		KVMShareDialog.isMasterSession = true;

		if (this.m_KVMClnt.redirection()) {
			OnChangeMenuState_KVMPartial(getJVMenu(), true);
			getInstance().getM_wndFrame().getToolbar().OnChangeToolbarIconState_KVMPartial();
		}
	}

	public int OnsendWebsessionToken() {
		int i = 0;
		int j = 0;
		int k = 0;

		if (JViewer.isKVMReconnectEnabled()) {
			if (getRetryConnection()) {
				return 0;
			}
			if (getKVMClient().OnFormIVTPHdr_Send((short) 58, 0, (short) 0) == -1) {
				return -1;
			}
		}
		i = getInstance().getSessionTokenType();

		j = 381;
		k = 130;

		IVTPPktHdr localIVTPPktHdr = new IVTPPktHdr((short) 18, j, (short) 0);
		String str = getInstance().getSessionToken();
		ByteBuffer localByteBuffer = ByteBuffer.allocate(j);

		byte[] arrayOfByte1 = new byte[k];
		arrayOfByte1 = str.getBytes();

		localByteBuffer.position(0);
		localByteBuffer.put(localIVTPPktHdr.array());
		localByteBuffer.put((byte) 0);
		localByteBuffer.put(str.getBytes());
		Debug.out.println("Hashed token");
		Debug.out.dump(arrayOfByte1);

		for (int m = localByteBuffer.position(); m < 8 + k; m++) {
			localByteBuffer.put((byte) 0);
		}
		localByteBuffer.put(KVMSharing.KVM_CLIENT_OWN_IP.getBytes());
		for (int m = localByteBuffer.position(); m < 8 + k + 65; m++) {
			localByteBuffer.put((byte) 0);
		}
		KVMSharing.KVM_CLIENT_OWN_USERNAME = getClientUserName();
		localByteBuffer.put(KVMSharing.KVM_CLIENT_OWN_USERNAME.getBytes());
		for (int m = localByteBuffer.position(); m < 8 + k + 65 + 129; m++) {
			localByteBuffer.put((byte) 0);
		}
		String[] arrayOfString = null;
		try {
			KVMSharing.KVM_CLIENT_OWN_MAC = getMacAddress(1, arrayOfString);

			if (KVMSharing.KVM_CLIENT_OWN_MAC.contains(":")) {
				KVMSharing.KVM_CLIENT_OWN_MAC = KVMSharing.KVM_CLIENT_OWN_MAC.replaceAll(":", "-");
			}
		} catch (Exception localException) {
			Debug.out.println("Failed to get mac Address");
			return -1;
		}

		localByteBuffer.put(KVMSharing.KVM_CLIENT_OWN_MAC.getBytes());
		for (int n = localByteBuffer.position(); n < localByteBuffer.limit(); n++) {
			localByteBuffer.put((byte) 0);
		}
		localByteBuffer.position(0);
		byte[] arrayOfByte2 = new byte[localByteBuffer.limit()];
		localByteBuffer.get(arrayOfByte2);
		if (arrayOfByte2.length != getKVMClient().sendMessage(arrayOfByte2, arrayOfByte2.length)) {
			Debug.out.println("Failed to send Session token to the card");
			return -1;
		}

		if (getKVMClient().OnFormIVTPHdr_Send((short) 6, 0, (short) 0) == -1) {
			return -1;
		}
		return 0;
	}

	public int onReconnect() {
		int i = 0;
		int j = 0;
		Debug.out.println("<-Reconnect invoked->");
		if ((getKVMClient().isStopSignalRecieved() == true) || (this.m_RedirectionState == REDIR_STOPPED)
				|| (this.m_RedirectionState == REDIR_STOPPING)) {
			Debug.out.println("Stop signal has been reached so no need reconnect");
			return 0;
		}

		if ((KVMSharing.KVM_REQ_GIVEN != 1) && (this.currentRetryCount < JViewer.getRetryCount())) {
			this.m_KVMClnt.checkReconnect();
		} else {
			Debug.out.println("<-Reconnect not possbile as max retry count is reached->");

			JViewer.exit(0);
		}

		String[] arrayOfString1 = { "VideoExit", "HelpAboutJViewer", "VideoFullScreen" };
		String[] arrayOfString2 = getExceptionMenuList(arrayOfString1);
		this.m_frame.getMenu().enableMenu(arrayOfString2, false, false);
		InfoDialog.showDialog(JViewer.getMainFrame(), LocaleStrings.getString("D_64_JVAPP"), 4);

		if (getInstance().getVMDialog() != null) {
			getInstance().getVMDialog().showDialog(false);
		}

		getInstance().OnVideoStartRedirection();

		i = 382;
		j = 130;

		IVTPPktHdr localIVTPPktHdr = new IVTPPktHdr((short) 58, 374, (short) 0);
		String str = getInstance().getSessionToken();
		ByteBuffer localByteBuffer = ByteBuffer.allocate(i);
		localByteBuffer.order(ByteOrder.LITTLE_ENDIAN);
		localByteBuffer.position(0);
		localByteBuffer.put(localIVTPPktHdr.array());

		localByteBuffer.put(str.getBytes());
		for (int k = localByteBuffer.position(); k < 8 + j; k++) {
			localByteBuffer.put((byte) 0);
		}
		localByteBuffer.put(KVMSharing.KVM_CLIENT_OWN_IP.getBytes());
		for (int k = localByteBuffer.position(); k < 8 + j + 65; k++) {
			localByteBuffer.put((byte) 0);
		}
		KVMSharing.KVM_CLIENT_OWN_USERNAME = getClientUserName();
		localByteBuffer.put(KVMSharing.KVM_CLIENT_OWN_USERNAME.getBytes());
		for (int k = localByteBuffer.position(); k < 8 + j + 65 + 129; k++) {
			localByteBuffer.put((byte) 0);
		}
		String[] arrayOfString3 = null;
		try {
			KVMSharing.KVM_CLIENT_OWN_MAC = getMacAddress(1, arrayOfString3);

			if (KVMSharing.KVM_CLIENT_OWN_MAC.contains(":")) {
				KVMSharing.KVM_CLIENT_OWN_MAC = KVMSharing.KVM_CLIENT_OWN_MAC.replaceAll(":", "-");
			}
		} catch (Exception localException) {
			Debug.out.println("Failed to get mac Address");
			return -1;
		}

		localByteBuffer.put(KVMSharing.KVM_CLIENT_OWN_MAC.getBytes());
		for (int m = localByteBuffer.position(); m < 8 + j + 65 + 129 + 49; m++) {
			localByteBuffer.put((byte) 0);
		}
		localByteBuffer.put((byte) getInstance().getCurrentSessionId());

		localByteBuffer.position(0);
		byte[] arrayOfByte = new byte[localByteBuffer.limit()];
		localByteBuffer.get(arrayOfByte);
		if (arrayOfByte.length != getKVMClient().sendMessage(arrayOfByte, arrayOfByte.length)) {
			Debug.out.println("Failed to send Reconnect Session token to the card");
			return -1;
		}

		return 1;
	}

	public int onSendWebPreviewerSession() {
		if (JViewer.isKVMReconnectEnabled()) {
			IVTPPktHdr localIVTPPktHdr = new IVTPPktHdr((short) 58, 0, (short) 0);

			if (getKVMClient().sendMessage(localIVTPPktHdr.array(), localIVTPPktHdr.size()) != localIVTPPktHdr.size()) {
				return -1;
			}
		}
		IVTPPktHdr localIVTPPktHdr = new IVTPPktHdr((short) 26, 0, (short) 0);

		if (getKVMClient().sendMessage(localIVTPPktHdr.array(), localIVTPPktHdr.size()) != localIVTPPktHdr.size()) {
			return -1;
		}
		return 0;
	}

	public void setWebPreviewerCaptureStatus(byte paramByte) {
		m_webPreviewer_cap_status = paramByte;
	}

	public byte getWebPreviewerCaptureStatus() {
		return m_webPreviewer_cap_status;
	}

	public void OnKvmPrevilage(short paramShort) {
		int i = (byte) paramShort;
		byte b = (byte) (paramShort >> 8);

		if (i == 6) {
			if ((this.kVMDialog != null) && (this.kVMDialog.getKVMShareRequestDialog() != null)) {
				this.kVMDialog.disposeKVMShareReqestDialog();
			}
			if (b == 0) {
				onKVMFullPermission();
			} else {
				onKVMPartialPermission((byte) 2);
			}
		}

		Object localObject1;
		if (i == 1) {

			if (KVMSharing.BLOCK_KVM_REQ == true) {
				Debug.out.println("KVM master permission request blocked");
				localObject1 = KVMSharing.KVM_CLIENT_USERNAME + " : " + KVMSharing.KVM_CLIENT_IP + " : "
						+ KVMSharing.KVM_CLIENT_SESSION_INDEX;

				OnSendKVMPrevilage((byte) 6, (String) localObject1);
				return;
			}

			localObject1 = null;
			localObject1 = new KVMResponseDialogThread();
			((Thread) localObject1).start();
			KVMSharing.KVM_PRIV_RES_USER = 1;
			return;
		}

		if (i == 2) {
			localObject1 = new String[] { "VideoExit", "HelpAboutJViewer" };
			this.kVMDialog = new KVMShareDialog();
			this.kVMDialog.setUserStatus(false);
			if (this.fullPermissionRequest) {
				this.kVMDialog.constructDialog((byte) 2);
			} else
				this.kVMDialog.constructDialog((byte) 0);
			this.kVMDialog.showDialog();
			KVMSharing.KVM_PRIV_RES_USER = 2;

			if (!this.fullPermissionRequest)
				getJVMenu().enableMenu((String[]) localObject1, false, true);
			return;
		}

		if (i == 0) {
			Debug.out.println("Cancel Packet received");
			this.kVMDialog.disposeKVMShareResponseDialog();
			if (this.fullPermissionRequest) {
				setFullPermissionRequest(false);
			}

			return;
		}

		Object localObject2;
		if (i == 3) {
			localObject1 = null;
			localObject1 = new KVMRequestDialogThread();
			setMessage(LocaleStrings.getString("D_33_JVAPP") + KVMSharing.KVM_CLIENT_USERNAME
					+ LocaleStrings.getString("D_34_JVAPP") + KVMSharing.KVM_CLIENT_IP
					+ LocaleStrings.getString("D_35_JVAPP"));

			((Thread) localObject1).start();
			if (getM_frame().getConfirmationLabel() != null) {
				localObject2 = SwingUtilities.getWindowAncestor(getM_frame().getConfirmationLabel());

				((Window) localObject2).setVisible(false);
				((Window) localObject2).dispose();
			}

			KVMSharing.KVM_REQ_GIVEN = 2;
			KVMShareDialog.isMasterSession = false;

			if ((this.kVMDialog != null) && (this.kVMDialog.getKVMShareRequestDialog() != null)) {
				this.kVMDialog.disposeKVMShareReqestDialog();
			}
			getM_frame().onStopVMediaRedirection(0);
			if (this.m_wndMode) {
				OnChangeMenuState_KVMPartial(getM_wndFrame().getMenu(), false);
				getM_wndFrame().getToolbar().OnChangeToolbarIconState_KVMPartial();
			} else {
				OnChangeMenuState_KVMPartial(getM_fsFrame().getMenu(), false);
			}
			if (isFullPermissionRequest()) {
				setFullPermissionRequest(false);
			} else {
				getJVMenu().removeBlockPermissionMenuItem();
				getJVMenu().addFullPermissionMenuItem();
			}
			return;
		}

		if (i == 4) {
			Debug.out.println("#########Got from user2########### and usercommand byte is:" + b);
			if (this.kVMDialog != null) {
				this.kVMDialog.disposeKVMShareReqestDialog();
			}
			localObject1 = null;
			localObject1 = new KVMRequestDialogThread();

			if (b == 0) {
				onKVMFullPermission();
			} else if ((b == 2) || (b == 6)) {

				onKVMPartialPermission(b);
			} else if ((b == 5) || (b == 7)) {

				localObject2 = getInstance().getMainWindow();
				if (b == 5) {
					InfoDialog.showDialog((Component) localObject2, LocaleStrings.getString("D_59_JVAPP"),
							LocaleStrings.getString("D_32_JVAPP"), 1);
				} else if (b == 7)
					InfoDialog.showDialog((Component) localObject2, LocaleStrings.getString("D_68_JVAPP"),
							LocaleStrings.getString("D_32_JVAPP"), 1);
				onKVMPartialPermission((byte) 5);
			} else if (b == 3) {
				Debug.out.println("IVTPPktHdr.KVM_REQ_TIMEOUT");
				this.kVMDialog.disposeKVMShareReqestDialog();
				setMessage(LocaleStrings.getString("D_41_JVAPP") + KVMSharing.KVM_CLIENT_USERNAME
						+ LocaleStrings.getString("D_36_JVAPP") + KVMSharing.KVM_CLIENT_IP);

				((Thread) localObject1).start();

				KVMSharing.KVM_REQ_GIVEN = 0;
				KVMShareDialog.isMasterSession = true;
				if (this.m_wndMode) {
					OnChangeMenuState_KVMPartial(getM_wndFrame().getMenu(), true);
					getM_wndFrame().getToolbar().OnChangeToolbarIconState_KVMPartial();
				} else {
					OnChangeMenuState_KVMPartial(getM_fsFrame().getMenu(), false);
				}
				if (isFullPermissionRequest()) {
					setFullPermissionRequest(false);
					getJVMenu().removeFullPermissionMenuItem();
					getJVMenu().addBlockPermissionMenuItem();
				}
			} else if (b == 1) {
				Debug.out.println("IVTPPktHdr.KVM_REQ_DENIED");
				this.kVMDialog.disposeKVMShareReqestDialog();
				KVMSharing.KVM_REQ_GIVEN = 1;
				getInstance().getKVMClient().setM_redirection(true);
				OnVideoStopRedirection();
				JOptionPane.showMessageDialog(getInstance().getMainWindow(), LocaleStrings.getString("D_42_JVAPP"));

				getInstance().getM_frame().windowClosed();

			} else if (b == 4) {
				if (KVMSharing.KVM_REQ_GIVEN == 1) {
					KVMSharing.KVM_REQ_GIVEN = 2;
					KVMShareDialog.isMasterSession = false;
					if (this.m_wndMode) {
						OnChangeMenuState_KVMPartial(getM_wndFrame().getMenu(), false);
						getM_wndFrame().getToolbar().OnChangeToolbarIconState_KVMPartial();
					} else {
						OnChangeMenuState_KVMPartial(getM_fsFrame().getMenu(), false);
					}
					if (isFullPermissionRequest()) {
						setFullPermissionRequest(false);
					} else {
						getJVMenu().addFullPermissionMenuItem();
					}
				}
				InfoDialog.showDialog(getInstance().getMainWindow(), LocaleStrings.getString("D_55_JVAPP"),
						LocaleStrings.getString("D_56_JVAPP"), 1);
			}

			return;
		}
	}

	public boolean OnCheckSameClient(String paramString) {
		byte[] arrayOfByte1 = null;
		byte[] arrayOfByte2 = null;
		InetAddress localInetAddress1 = null;
		InetAddress localInetAddress2 = null;
		boolean bool = false;
		try {
			localInetAddress1 = InetAddress.getByName(paramString);
			localInetAddress2 = InetAddress.getByName(KVMSharing.KVM_CLIENT_OWN_IP);

			String str1 = localInetAddress1.getHostAddress();
			String str2 = localInetAddress2.getHostAddress();
			arrayOfByte1 = InetAddress.getByName(str1).getAddress();
			arrayOfByte2 = InetAddress.getByName(str2).getAddress();
		} catch (UnknownHostException localUnknownHostException1) {
			Debug.out.println(localUnknownHostException1);
		} catch (Exception localException) {
			Debug.out.println(localException);
		}
		try {
			if (InetAddress.getByAddress(arrayOfByte1).equals(InetAddress.getByAddress(arrayOfByte2))) {

				Debug.out.println("Equals");
				bool = true;

			} else {

				Debug.out.println("Not Equals");
				bool = false;
			}
		} catch (UnknownHostException localUnknownHostException2) {
			localUnknownHostException2.printStackTrace();
		}
		return bool;
	}

	private void OnChangeMenuState_KVMPartial(JVMenu paramJVMenu, boolean paramBoolean) {
		getOEMManager().getOEMJVMenu().enableMenuOnKVMPartial(paramBoolean);
		if (this.powerStatus == 0) {
			if (KVMSharing.KVM_REQ_GIVEN == 2) {
				this.m_frame.getMenu().notifyMenuStateEnable("Power On Server", false);
				this.m_frame.getMenu().notifyMenuStateEnable("DeviceMediaDialog", false);
			} else if (paramBoolean) {
				this.m_frame.getMenu().notifyMenuStateEnable("Power On Server", true);
				this.m_frame.getMenu().notifyMenuStateEnable("DeviceMediaDialog", true);
				enablePowerControls(paramBoolean);
			}
			return;
		}

		String[] arrayOfString1 = JVMenu.KVMPartialExceptionMenuItems;
		String[] arrayOfString2 = getExceptionMenuList(arrayOfString1);
		paramJVMenu.enableMenu(arrayOfString2, paramBoolean, true);
		if (paramBoolean) {
			enablePowerControls(paramBoolean);
		}
	}

	public int getSelectedVMTab() {
		return this.selectedVMTab;
	}

	public void setSelectedVMTab(int paramInt) {
		this.selectedVMTab = paramInt;
	}

	public void OnvMedia(int paramInt) {
		setSelectedVMTab(paramInt);
		if (!JViewer.isVMApp()) {
			this.vmDialog = VMApp.getVMDialog();

			if ((this.vmDialog != null) && (this.vmDialog.isShowing())) {
				return;
			}
			if ((this.vmDialog != null) && (!this.vmDialog.isShowing())) {
				this.vmDialog.setLocation(
						getInstance().getPopUpWindowPosition(this.vmDialog.getWidth(), this.vmDialog.getHeight()));
				this.vmDialog.showDialog(true);
				return;
			}
		}
		VMApp.launchApp();
	}

	public VMDialog getVMDialog() {
		return this.vmDialog;
	}

	public void setVMDialog(VMDialog paramVMDialog) {
		this.vmDialog = paramVMDialog;
	}

	public void OnVideoRecordSettings() {
		if (this.m_videorecord == null)
			this.m_videorecord = new VideoRecord();
		this.m_videorecord.VideoRecordsettings();
	}

	public void reportCDROMAbnormal(int paramInt) {
		VMApp.getInstance().getIUSBRedirSession().stopCDROMAbnormal(paramInt);
		if (JViewer.isVMApp()) {
			VMApp.getVMPane().getDeviceControlPanel(0, paramInt).updateDeviceControlPanel();
			VMApp.getInstance().getIUSBRedirSession().updateCDToolbarButtonStatus(false);

		} else if (getVMDialog() != null) {
			VMApp.getVMPane().getDeviceControlPanel(0, paramInt).updateDeviceControlPanel();
			if ((JViewer.isjviewerapp()) || (JViewer.isStandalone())) {
				VMApp.getVMPane().updateJVToolbar(0);
			}
		}
	}

	public void reportFloppyAbnormal(int paramInt) {
		VMApp.getInstance().getIUSBRedirSession().stopFloppyAbnormal(paramInt);
		if (JViewer.isVMApp()) {
			VMApp.getVMPane().getDeviceControlPanel(1, paramInt).updateDeviceControlPanel();
			VMApp.getInstance().getIUSBRedirSession().updateFDToolbarButtonStatus(false);

		} else if (getVMDialog() != null) {
			VMApp.getVMPane().getDeviceControlPanel(1, paramInt).updateDeviceControlPanel();
			if ((JViewer.isjviewerapp()) || (JViewer.isStandalone())) {
				VMApp.getVMPane().updateJVToolbar(1);
			}
		}
	}

	public void reportHarddiskAbnormal(int paramInt) {
		VMApp.getInstance().getIUSBRedirSession().stopHarddiskAbnormal(paramInt);
		if (JViewer.isVMApp()) {
			VMApp.getVMPane().getDeviceControlPanel(2, paramInt).updateDeviceControlPanel();
			VMApp.getInstance().getIUSBRedirSession().updateHDToolbarButtonStatus(false);

		} else if (getVMDialog() != null) {
			VMApp.getVMPane().getDeviceControlPanel(2, paramInt).updateDeviceControlPanel();
			if ((JViewer.isjviewerapp()) || (JViewer.isStandalone())) {
				VMApp.getVMPane().updateJVToolbar(2);
			}
		}
	}

	public boolean IsCDROMRedirRunning(int paramInt) {
		try {
			if (VMApp.getInstance().getIUSBRedirSession().getCDROMRedirStatus(paramInt) == 1)
				return true;
		} catch (Exception localException) {
			Debug.out.println(localException);
		}
		return false;
	}

	public boolean IsCDROMRedirRunning() {
		int i = 0;

		i = VMApp.getInstance().getNumCD();
		for (int j = 0; j < i; j++) {
			try {
				if (VMApp.getInstance().getIUSBRedirSession().getCDROMRedirStatus(j) == 1)
					return true;
			} catch (Exception localException) {
				Debug.out.println(localException);
				return false;
			}
		}
		return false;
	}

	public boolean IsFloppyRedirRunning(int paramInt) {
		try {
			if (VMApp.getInstance().getIUSBRedirSession().getFloppyRedirStatus(paramInt) == 1)
				return true;
		} catch (Exception localException) {
			Debug.out.println(localException);
		}
		return false;
	}

	public boolean IsFloppyRedirRunning() {
		int i = 0;
		i = VMApp.getInstance().getNumFD();
		for (int j = 0; j < i; j++) {
			try {
				if (VMApp.getInstance().getIUSBRedirSession().getFloppyRedirStatus(j) == 1)
					return true;
			} catch (Exception localException) {
				Debug.out.println(localException);
				return false;
			}
		}
		return false;
	}

	public boolean IsHarddiskRedirRunning(int paramInt) {
		try {
			if (VMApp.getInstance().getIUSBRedirSession().getHarddiskRedirStatus(paramInt) == 1)
				return true;
		} catch (Exception localException) {
			Debug.out.println(localException);
		}
		return false;
	}

	public boolean IsHarddiskRedirRunning() {
		int i = 0;
		i = VMApp.getInstance().getNumHD();
		for (int j = 0; j < i; j++) {
			try {
				if (VMApp.getInstance().getIUSBRedirSession().getHarddiskRedirStatus(j) == 1)
					return true;
			} catch (Exception localException) {
				return false;
			}
		}
		return false;
	}

	public int getCDPort() {
		return this.m_cdPort;
	}

	public int getFDPort() {
		return this.m_fdPort;
	}

	public int getHDPort() {
		return this.m_hdPort;
	}

	public int getCDStatus() {
		return this.m_cdStatus;
	}

	public int getFDStatus() {
		return this.m_fdStatus;
	}

	public int getHDStatus() {
		return this.m_hdStatus;
	}

	public String getM_webSession_token() {
		return JViewer.getWebSessionToken();
	}

	public void setM_webSession_token(String paramString) {
		JViewer.setWebSessionToken(paramString);
	}

	public JVFrame getM_frame() {
		return this.m_frame;
	}

	public FSFrame getM_fsFrame() {
		return this.m_fsFrame;
	}

	public boolean isM_wndMode() {
		return this.m_wndMode;
	}

	public void setM_wndMode(boolean paramBoolean) {
		this.m_wndMode = paramBoolean;
	}

	public ISOCApp getSoc_App() {
		return this.soc_App;
	}

	public void setSoc_App(ISOCApp paramISOCApp) {
		this.soc_App = paramISOCApp;
	}

	public JViewerView getM_view() {
		return this.m_view;
	}

	public void setM_view(JViewerView paramJViewerView) {
		this.m_view = paramJViewerView;
	}

	public static ISOCManager getSoc_manager() {
		return soc_manager;
	}

	public ISOCFrameHdr getSocframeHdr() {
		return this.socframeHdr;
	}

	public void setSocframeHdr(ISOCFrameHdr paramISOCFrameHdr) {
		this.socframeHdr = paramISOCFrameHdr;
	}

	public WindowFrame getM_wndFrame() {
		return this.m_wndFrame;
	}

	public void setM_wndFrame(WindowFrame paramWindowFrame) {
		this.m_wndFrame = paramWindowFrame;
	}

	public JVVideo getVidClnt() {
		return this.vidClnt;
	}

	public void setVidClnt(JVVideo paramJVVideo) {
		this.vidClnt = paramJVVideo;
	}

	public ISOCCreateBuffer getPrepare_buf() {
		return this.prepare_buf;
	}

	public ISOCKvmClient getSockvmclient() {
		return this.sockvmclient;
	}

	public void setSockvmclient(ISOCKvmClient paramISOCKvmClient) {
		this.sockvmclient = paramISOCKvmClient;
	}

	public void onAutoKeyboardLayout(boolean paramBoolean1, boolean paramBoolean2) {
		getJVMenu().getMenuItem("NONE").setSelected(true);

		if (paramBoolean1 == true) {
			JVMenu.keyBoardLayout *= -1;
			getJVMenu().notifyMenuStateSelected("Auto detect", true);

			JViewer.setKeyboardLayout("AD");
			if ((paramBoolean2 == true) && ((JViewer.getOEMFeatureStatus() & 0x8) == 8L)) {

				String str = LocaleStrings.getString("S_22_SACD") + " " + LocaleStrings.getString("S_21_SACD");
				InfoDialog.showDialog(this.m_frame, LocaleStrings.getString("M_1_ID") + str + "?", str, 3, 5000L, 0);
			}

			if (getAutokeylayout() == null) {
				setAutokeylayout(new AutoKeyboardLayout());
				getAutokeylayout().setKeyboardType(0);
				getAutokeylayout().setHostKeyboardType(0);
			} else {
				getAutokeylayout().setKeyboardType(0);
				getAutokeylayout().setHostKeyboardType(0);
				getAutokeylayout().initKeyProcessor();
				getAutokeylayout().getKeyboardType();
				getAutokeylayout().ongetKeyprocessor();
			}
			OnSkbrdDisplay(-1);
		} else {
			if (JVMenu.keyBoardLayout != -1)
				JVMenu.keyBoardLayout *= -1;
			JVMenu.keyBoardLayout = JVMenu.softkeyBoardLayout;
			getJVMenu().getMenu("SoftKeyboard").setEnabled(true);
			getJVMenu().notifyMenuStateSelected("Auto detect", false);
			getJVMenu().SetMenuEnable("SoftKeyboard", Boolean.valueOf(true));
			getJVMenu();
			JVMenu.m_menuItems_setenabled.put("SoftKeyboard", Boolean.valueOf(true));
		}
		getInstance().getM_USBKeyRep().setM_USBKeyProcessor(getInstance().getKeyProcesssor());
	}

	public AutoKeyboardLayout getAutokeylayout() {
		return this.autokeylayout;
	}

	public void setAutokeylayout(AutoKeyboardLayout paramAutoKeyboardLayout) {
		this.autokeylayout = paramAutoKeyboardLayout;
	}

	public KeyProcessor getKeyProcesssor() {
		if (this.autokeylayout == null) {
			this.autokeylayout = new AutoKeyboardLayout();
			this.keyprocessor = new USBKeyProcessorEnglish();
		} else {
			this.keyprocessor = this.autokeylayout.ongetKeyprocessor();
		}
		this.keyprocessor.setAutoKeybreakMode(true);
		return this.keyprocessor;
	}

	public void setKeyProcessor(String paramString) {
		int i = 1033;

		if (JViewer.getKeyboardLayout().equals(paramString)) {
			return;
		}
		if (paramString.equalsIgnoreCase("US")) {
			i = 1033;
		} else if (paramString.equalsIgnoreCase("FR")) {
			i = 1036;
		} else if (paramString.equalsIgnoreCase("DE")) {
			i = 1031;
		} else if (paramString.equalsIgnoreCase("JP")) {
			i = 1041;
		} else if (paramString.equalsIgnoreCase("ES")) {
			i = 1034;
		} else if (paramString.equalsIgnoreCase("GB")) {
			i = 2057;
		} else if (paramString.equalsIgnoreCase("DE-CH")) {
			i = 2055;
		} else if (paramString.equalsIgnoreCase("FR-BE")) {
			i = 2060;
		} else if (paramString.equalsIgnoreCase("IT")) {
			i = 1040;
		} else if (paramString.equalsIgnoreCase("DA")) {
			i = 1030;
		} else if (paramString.equalsIgnoreCase("FI")) {
			i = 1035;
		} else if (paramString.equalsIgnoreCase("NO")) {
			i = 1044;
		} else if (paramString.equalsIgnoreCase("PT")) {
			i = 2070;
		} else if (paramString.equalsIgnoreCase("SV")) {
			i = 1053;
		} else if (paramString.equalsIgnoreCase("NL-NL")) {
			i = 1043;
		} else if (paramString.equalsIgnoreCase("NL-BE")) {
			i = 2067;
		} else if (paramString.equalsIgnoreCase("TR_F")) {
			i = 66591;
		} else if (paramString.equalsIgnoreCase("TR_Q")) {
			i = 1055;
		}
		if (this.autokeylayout == null) {
			this.autokeylayout = new AutoKeyboardLayout();
		}
		getJVMenu().notifyMenuStateSelected("Auto detect", false);

		if (!getJVMenu().getMenuEnable("SoftKeyboard").booleanValue()) {
			getJVMenu().notifyMenuEnable("SoftKeyboard", true);
			JVMenu.keyBoardLayout *= -1;
		}
		if (this.softKeyboard != null) {
			this.softKeyboard.m_skmouselistener.close();
			this.softKeyboard.dispose();
		}
		this.autokeylayout.setHostKeyboardType(i);
		JViewer.setKeyboardLayout(paramString);
		getM_USBKeyRep().setM_USBKeyProcessor(getKeyProcesssor());

		if ((JViewer.getOEMFeatureStatus() & 0x8) == 8L) {

			String str = LocaleStrings.getString("S_22_SACD") + " " + LocaleStrings.getString("S_21_SACD");
			InfoDialog.showDialog(this.m_frame, LocaleStrings.getString("M_1_ID") + str + "?", str, 3, 5000L, 0);
		}
	}

	public USBKeyboardRep getM_USBKeyRep() {
		return this.m_USBKeyRep;
	}

	public void setM_USBKeyRep(USBKeyboardRep paramUSBKeyboardRep) {
		this.m_USBKeyRep = paramUSBKeyboardRep;
	}

	public SoftKeyboard getSoftKeyboard() {
		return this.softKeyboard;
	}

	public void setSoftKeyboard(SoftKeyboard paramSoftKeyboard) {
		this.softKeyboard = paramSoftKeyboard;
	}

	public VideoRecord getM_videorecord() {
		return this.m_videorecord;
	}

	public void setM_videorecord(VideoRecord paramVideoRecord) {
		this.m_videorecord = paramVideoRecord;
	}

	public AddMacro getAddMacro() {
		return this.addMacro;
	}

	public void setAddMacro(AddMacro paramAddMacro) {
		this.addMacro = paramAddMacro;
	}

	public UserDefMacro getUserDefMacro() {
		return this.userDefMacro;
	}

	public void OnAddMacro() {
		if (getInstance().getAddMacro() == null)
			return;
		this.userDefMacro = new UserDefMacro(JViewer.getMainFrame());
	}

	public void OnVideoZoomIn() {
		this.m_zoomSliderValue = getM_wndFrame().getToolbar().getSlider_zoom().getValue();
		if (JVMenu.m_scale <= 1.5D) {
			BigDecimal localBigDecimal1 = new BigDecimal(JVMenu.m_scale);
			BigDecimal localBigDecimal2 = new BigDecimal("0.1");
			BigDecimal localBigDecimal3 = localBigDecimal1.add(localBigDecimal2).setScale(2, 4);
			JVMenu.m_scale = localBigDecimal3.floatValue();
			this.m_zoomSliderValue += 10;
			getM_wndFrame().getToolbar().getSlider_zoom().setValue(this.m_zoomSliderValue);
			getInstance().getRCView().revalidate();
			getInstance().getRCView().repaint();
		}

		if (JVMenu.m_scale >= 0.5D) {
			getJVMenu().SetMenuEnable("Zoom Out", Boolean.valueOf(true));
			getJVMenu().getMenuItem("Zoom Out").setEnabled(true);
		}

		if (JVMenu.m_scale >= 1.5D) {
			getJVMenu().SetMenuEnable("Zoom In", Boolean.valueOf(false));
			getJVMenu().getMenuItem("Zoom In").setEnabled(false);
		}

		if (this.m_zoomSliderValue == 100) {
			boolean bool = getInstance().getJVMenu().getMenuSelected("MouseShowCursor").booleanValue();
			if (bool)
				Mousecaliberation.resetCursor();
		}
	}

	public void OnVideoZoomOut() {
		this.m_zoomSliderValue = getM_wndFrame().getToolbar().getSlider_zoom().getValue();
		if (JVMenu.m_scale >= 0.5D) {
			BigDecimal localBigDecimal1 = new BigDecimal(JVMenu.m_scale);
			BigDecimal localBigDecimal2 = new BigDecimal("0.1");
			BigDecimal localBigDecimal3 = localBigDecimal1.subtract(localBigDecimal2).setScale(2, 4);
			JVMenu.m_scale = localBigDecimal3.floatValue();
			this.m_zoomSliderValue -= 10;
			getM_wndFrame().getToolbar().getSlider_zoom().setValue(this.m_zoomSliderValue);
			getInstance().getRCView().revalidate();
			getInstance().getRCView().repaint();
		}

		if (JVMenu.m_scale <= 0.5D) {
			getJVMenu().SetMenuEnable("Zoom Out", Boolean.valueOf(false));
			getJVMenu().getMenuItem("Zoom Out").setEnabled(false);
		}
		if (JVMenu.m_scale >= 0.5D) {
			getJVMenu().SetMenuEnable("Zoom In", Boolean.valueOf(true));
			getJVMenu().getMenuItem("Zoom In").setEnabled(true);
		}

		if (this.m_zoomSliderValue == 100) {
			boolean bool = getInstance().getJVMenu().getMenuSelected("MouseShowCursor").booleanValue();
			if (bool) {
				Mousecaliberation.resetCursor();
			}
		}
	}

	public void onChangeZoomOptions(String paramString) {
		if (JViewerView.syncLEDFlag == true)
			return;
		GraphicsConfiguration localGraphicsConfiguration = getInstance().getM_wndFrame().getGraphicsConfiguration();
		Dimension localDimension1 = getCurrentMonitorResolution();
		Point localPoint = getWindowPostionToSet();
		Insets localInsets = new Insets(0, 0, 0, 0);
		try {
			localInsets = Toolkit.getDefaultToolkit().getScreenInsets(localGraphicsConfiguration);
		} catch (NullPointerException localNullPointerException) {
		}

		int i = localInsets.top + localInsets.bottom;
		int j = localInsets.left + localInsets.right;
		int k = localDimension1.height - i;
		int m = localDimension1.width - j;

		if (paramString.equals("ActualSize")) {
			if (this.zoomOption != "ZoomOption None") {
				if ((!isRenderFitToHost()) && (this.m_wndFrame.isResizeFrame())) {
					JViewer.getMainFrame().setSize(this.m_wndFrame.getFrameDimension());
				} else {
					JViewer.getMainFrame().setSize(m, k);
					JViewer.getMainFrame().setLocation(localPoint);
				}
			}
			setZoomOption(paramString);
			getM_wndFrame().getToolbar().resetZoom();
			if (getRCView().GetUSBMouseMode() != USBMouseRep.OTHER_MOUSE_MODE) {
				JViewer.getMainFrame().setResizable(true);
				getInstance().getMainWindow().m_viewSP.setHorizontalScrollBarPolicy(30);
				getInstance().getMainWindow().m_viewSP.setVerticalScrollBarPolicy(20);
			}
			getM_wndFrame().getToolbar().enableZoomSlider(true);
			getJVMenu().notifyMenuStateEnable("Zoom In", true);
			getJVMenu().notifyMenuStateEnable("Zoom Out", true);
			getJVMenu().notifyMenuStateSelected("ActualSize", true);
		} else if (paramString.equals("FitToClientResolution")) {
			getM_wndFrame().getToolbar().resetZoom();

			JViewer.getMainFrame().setLocation(localPoint);

			getInstance().getMainWindow().m_viewSP.setHorizontalScrollBarPolicy(31);
			getInstance().getMainWindow().m_viewSP.setVerticalScrollBarPolicy(21);
			JViewer.getMainFrame().setSize(m, k);
			getInstance().getRCView().revalidate();
			getInstance().getRCView().repaint();
			JViewer.getMainFrame().setResizable(false);
			setZoomOption(paramString);
			getM_wndFrame().getToolbar().enableZoomSlider(false);
			if (getRCView().GetUSBMouseMode() == USBMouseRep.RELATIVE_MOUSE_MODE) {
				getM_wndFrame().getToolbar().changeShowCursorOnZoom();
			}
			getJVMenu().notifyMenuStateEnable("Zoom In", false);
			getJVMenu().notifyMenuStateEnable("Zoom Out", false);
			getJVMenu().notifyMenuStateSelected("FitToClientResolution", true);
		} else if (paramString.equals("FitToHostResolution")) {
			int n = getSocframeHdr().getresX();
			int i1 = getSocframeHdr().getresY();

			int i2 = JViewer.getMainFrame().getInsets().top
					+ getInstance().getM_wndFrame().getWindowMenu().getMenuBar().getHeight()
					+ getInstance().getM_wndFrame().getToolbar().getToolBar().getHeight()
					+ getInstance().getM_wndFrame().getToolbar().getToolBar().getInsets().top
					+ getInstance().getM_wndFrame().getToolbar().getToolBar().getInsets().bottom
					+ getInstance().getM_wndFrame().getM_status().getStatusBar().getHeight()
					+ getInstance().getM_wndFrame().getM_status().getStatusBar().getInsets().top
					+ getInstance().getM_wndFrame().getM_status().getStatusBar().getInsets().bottom;

			int i3 = JViewer.getMainFrame().getInsets().left + JViewer.getMainFrame().getInsets().left
					+ getRCView().getInsets().left + getRCView().getInsets().right;

			Dimension localDimension2 = Toolkit.getDefaultToolkit().getScreenSize();

			m = n + i3;
			k = i1 + i2;

			if ((m + j < localDimension2.width) && (k + i < localDimension2.height)) {
				getM_wndFrame().getToolbar().resetZoom();
				JViewer.getMainFrame().setLocation(localPoint);
				JViewer.getMainFrame().setExtendedState(0);
				if ((n >= 800) && (i1 >= 600)) {
					JViewer.getMainFrame().setSize(m, k);
				} else
					JViewer.getMainFrame().setSize(800, 600);
				getInstance().getMainWindow().m_viewSP.setHorizontalScrollBarPolicy(31);
				getInstance().getMainWindow().m_viewSP.setVerticalScrollBarPolicy(21);
				JViewer.getMainFrame().setResizable(false);

				setZoomOption(paramString);
				if (getRCView().GetUSBMouseMode() == USBMouseRep.RELATIVE_MOUSE_MODE)
					getM_wndFrame().getToolbar().changeShowCursorOnZoom();
				getM_wndFrame().getToolbar().enableZoomSlider(false);
				getJVMenu().notifyMenuStateEnable("Zoom In", false);
				getJVMenu().notifyMenuStateEnable("Zoom Out", false);
				getJVMenu().notifyMenuStateSelected("FitToHostResolution", true);
			}
		}
		getM_wndFrame().getM_status().resetStatus();
		this.m_wndFrame.setResizeFrame(false);
	}

	public String getZoomOption() {
		return this.zoomOption;
	}

	public void setZoomOption(String paramString) {
		this.zoomOption = paramString;
	}

	public void onGetPowerControlStatus(byte paramByte) {
		if (paramByte == 1) {
			this.powerStatus = 1;
			try {
				getVidClnt().stopPsMonitorTaskAndTimer();
			} catch (Exception localException1) {
				Debug.out.println(localException1);
				localException1.printStackTrace();
			}
			if (getInstance().getSoftKeyboard() != null) {
				getInstance().getSoftKeyboard().OnUpdateKeyState(Boolean.valueOf(true));
			}
		} else if (paramByte == 0) {
			this.powerStatus = 0;
			try {
				getVidClnt().startPsMonitorTaskAndTimer();
			} catch (Exception localException2) {
				localException2.printStackTrace();
			}
			if (getInstance().getSoftKeyboard() != null) {
				getInstance().getSoftKeyboard().OnUpdateKeyState(Boolean.valueOf(false));
			}
		}
		enablePowerControls(true);
	}

	public void onSendPowerControlCommand(String paramString) {
		if (!JViewer.isPowerPrivEnabled()) {
			return;
		}
		JVFrame localJVFrame = getInstance().getMainWindow();
		UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
		int i = JOptionPane.showConfirmDialog(localJVFrame,
				LocaleStrings.getString("D_43_JVAPP") + paramString + LocaleStrings.getString("D_44_JVAPP"),
				LocaleStrings.getString("D_45_JVAPP"), 0);

		if (i == 0) {
			enablePowerControls(false);
			if (getInstance().getSoftKeyboard() != null) {
				getInstance().getSoftKeyboard().OnUpdateKeyState(Boolean.valueOf(false));
			}
			if (paramString.equals("Reset Server")) {
				this.m_KVMClnt.sendPowerControlCommand((byte) 3);
			} else if (paramString.equals("Immediate Shutdown")) {
				this.m_KVMClnt.sendPowerControlCommand((byte) 0);
			} else if (paramString.equals("Orderly Shutdown")) {
				this.m_KVMClnt.sendPowerControlCommand((byte) 5);
			} else if (paramString.equals("Power On Server")) {
				this.m_KVMClnt.sendPowerControlCommand((byte) 1);
			} else if (paramString.equals("Power Cycle Server")) {
				this.m_KVMClnt.sendPowerControlCommand((byte) 2);
			}
		}
	}

	public void enablePowerControls(boolean paramBoolean) {
		getOEMManager().getOEMJVMenu().enableMenuOnPowerControls();
		this.m_wndFrame.getToolbar().getPowerBtn().setEnabled(paramBoolean);
		if (paramBoolean) {
			if (this.powerStatus == 0) {
				String[] arrayOfString1 = { "VideoCaptureScreen", "VideoExit", "HelpAboutJViewer", "Power On Server",
						"DeviceMediaDialog", "VideoRecordSettings", "VideoRecordStart", "VideoRecordStop" };

				String[] arrayOfString2 = getOEMManager().getOEMJVMenu().getOemPowerControlExceptionList();
				if (arrayOfString2 != null) {
					String[] arrayOfString3 = new String[arrayOfString1.length + arrayOfString2.length];
					System.arraycopy(arrayOfString1, 0, arrayOfString3, 0, arrayOfString1.length);
					System.arraycopy(arrayOfString2, 0, arrayOfString3, 0, arrayOfString2.length);
					this.m_frame.getMenu().enableMenu(arrayOfString3, false, false);
				} else {
					this.m_frame.getMenu().enableMenu(arrayOfString1, false, false);
				}
				this.m_wndFrame.getToolbar().turnOnPowerButton(false);
				if (KVMSharing.KVM_REQ_GIVEN == 2) {
					this.m_frame.getMenu().notifyMenuStateEnable("Power On Server", false);
					this.m_frame.getMenu().notifyMenuStateEnable("DeviceMediaDialog", false);
				} else {
					this.m_frame.getMenu().notifyMenuStateEnable("Power On Server", true);
					this.m_frame.getMenu().notifyMenuStateEnable("DeviceMediaDialog", true);
					this.m_wndFrame.getToolbar().setButtonEnabled(this.m_wndFrame.getToolbar().getPowerBtn(), true);
				}
				this.m_wndFrame.getToolbar().changeToolbarButtonStateOnPowerStatus(false);

			} else if (this.m_RedirectionState == REDIR_STARTED) {
				changeMenuItemsStatusOnPauseResume(this.m_frame.getMenu(), true);
				this.m_wndFrame.getToolbar().changeToolbarButtonStateOnPowerStatus(true);
				this.m_frame.getMenu().notifyMenuStateEnable("Power On Server", false);
				this.m_wndFrame.getToolbar().turnOnPowerButton(true);
				getVidClnt().setZoomOptionStatus();
			}
		}
	}

	public void onPowerControlResponse(byte paramByte) {
		if (paramByte != 0) {
			InfoDialog.showDialog(getInstance().getMainWindow(), LocaleStrings.getString("D_46_JVAPP"),
					LocaleStrings.getString("D_45_JVAPP"), 2);
		} else {
			InfoDialog.showDialog(getInstance().getMainWindow(), LocaleStrings.getString("D_47_JVAPP"),
					LocaleStrings.getString("D_45_JVAPP"), 1);
		}

		enablePowerControls(true);
	}

	public Mousecaliberation getMousecaliberation() {
		return this.Mousecaliberation;
	}

	public void setMousecaliberation(Mousecaliberation paramMousecaliberation) {
		this.Mousecaliberation = paramMousecaliberation;
	}

	public int getM_cdStatus() {
		return this.m_cdStatus;
	}

	public int getM_fdStatus() {
		return this.m_fdStatus;
	}

	public int getM_hdStatus() {
		return this.m_hdStatus;
	}

	public void setM_cdStatus(int paramInt) {
		this.m_cdStatus = paramInt;
	}

	public void setM_fdStatus(int paramInt) {
		this.m_fdStatus = paramInt;
	}

	public void setM_hdStatus(int paramInt) {
		this.m_hdStatus = paramInt;
	}

	public String getMessage() {
		return this.Message;
	}

	public void setMessage(String paramString) {
		this.Message = paramString;
	}

	public String getServerIP() {
		return this.serverIP;
	}

	public void setServerIP(String paramString) {
		this.serverIP = paramString;
	}

	public VideoRecordApp getVideorecordapp() {
		return this.videorecordapp;
	}

	public void setVideorecordapp(VideoRecordApp paramVideoRecordApp) {
		this.videorecordapp = paramVideoRecordApp;
	}

	public int getM_hdPort() {
		return this.m_hdPort;
	}

	public void setM_hdPort(int paramInt) {
		this.m_hdPort = paramInt;
	}

	public int getM_fdPort() {
		return this.m_fdPort;
	}

	public void setM_fdPort(int paramInt) {
		this.m_fdPort = paramInt;
	}

	public int getM_cdPort() {
		return this.m_cdPort;
	}

	public void setM_cdPort(int paramInt) {
		this.m_cdPort = paramInt;
	}

	public boolean isM_bVMUseSSL() {
		return this.m_bVMUseSSL;
	}

	public void setM_bVMUseSSL(boolean paramBoolean) {
		this.m_bVMUseSSL = paramBoolean;
	}

	public boolean isFullKeyboardEnabled() {
		return this.fullKeyboardEnabled;
	}

	public void setFullKeyboardEnabled(boolean paramBoolean) {
		this.fullKeyboardEnabled = paramBoolean;
	}

	public boolean isFullPermissionRequest() {
		return this.fullPermissionRequest;
	}

	public void setFullPermissionRequest(boolean paramBoolean) {
		this.fullPermissionRequest = paramBoolean;
	}

	public boolean syncVMediaRedirection() {
		boolean bool = false;
		int i = 0;
		int j = 0;
		int k = 0;

		i = VMApp.getInstance().getNumCD();
		j = VMApp.getInstance().getNumFD();
		k = VMApp.getInstance().getNumHD();
		int m;
		synchronized (CDROMRedir.getSyncObj()) {
			for (m = 0; m < i; m++)
				if (VMApp.getInstance().getIUSBRedirSession().getCdromSession(m) != null) {
					VMApp.getInstance().getIUSBRedirSession().getCdromSession(m).setConfModified(true);
					if (VMApp.getInstance().getIUSBRedirSession().getCdromSession(m).isRedirActive())
						bool = true;
				}
			CDROMRedir.getSyncObj().notifyAll();
		}
		synchronized (FloppyRedir.getSyncObj()) {
			for (m = 0; m < j; m++)
				if (VMApp.getInstance().getIUSBRedirSession().getFloppySession(m) != null) {
					VMApp.getInstance().getIUSBRedirSession().getFloppySession(m).setConfModified(true);
					if (VMApp.getInstance().getIUSBRedirSession().getFloppySession(m).isRedirActive())
						bool = true;
				}
			FloppyRedir.getSyncObj().notifyAll();
		}
		synchronized (HarddiskRedir.getSyncObj()) {
			for (m = 0; m < k; m++)
				if (VMApp.getInstance().getIUSBRedirSession().getHarddiskSession(m) != null) {
					VMApp.getInstance().getIUSBRedirSession().getHarddiskSession(m).setConfModified(true);
					if (VMApp.getInstance().getIUSBRedirSession().getHarddiskSession(m).isRedirActive())
						bool = true;
				}
			HarddiskRedir.getSyncObj().notifyAll();
		}
		return bool;
	}

	public void OnSendMouseMode(byte paramByte) {
		if (!this.m_KVMClnt.redirection()) {
			return;
		}
		if (this.m_KVMClnt.SendMouseMode(paramByte) == 1)
			Debug.out.println("Mouse mode send failured");
		Debug.out.println("Mouse mode send success");
	}

	public void OnSelectKVMMaster() {
		if ((KVMClient.getNumUsers() > 1) && (KVMSharing.KVM_REQ_GIVEN == 0)) {
			if (this.kVMDialog == null)
				this.kVMDialog = new KVMShareDialog();
			this.kVMDialog.constructDialog((byte) 1);
			this.kVMDialog.showDialog();
		}
	}

	public KVMShareDialog getKVMShareDialog() {
		return this.kVMDialog;
	}

	public Hashtable<String, JDialog> getResponseDialogTable() {
		return this.responseDialogTable;
	}

	public void initResponseDialogTable() {
		if (this.responseDialogTable == null) {
			this.responseDialogTable = new Hashtable();
		}
	}

	public void setKVMDialog(KVMShareDialog paramKVMShareDialog) {
		this.kVMDialog = paramKVMShareDialog;
	}

	public void sendSelectedMasterInfo(String paramString) {
		ByteBuffer localByteBuffer = getKVMClient().getUserDataPacket().createUserDataBuffer(paramString);
		getKVMClient().sendNextMasterInfo(localByteBuffer);
	}

	private void onKVMFullPermission() {
		getJVMenu().getMenu("SoftKeyboard").setEnabled(true);
		getInstance().getM_wndFrame().getToolbar().getKbdBtn()
				.setEnabled(getJVMenu().getMenuItem("SKBD_English(United States)").isEnabled());

		getInstance().getM_wndFrame().getM_status().enableStatusBar(true);
		KVMRequestDialogThread localKVMRequestDialogThread = null;
		localKVMRequestDialogThread = new KVMRequestDialogThread();
		if ((KVMSharing.KVM_CLIENT_USERNAME != null) && (KVMSharing.KVM_CLIENT_IP != null)) {
			if (KVMSharing.KVM_REQ_GIVEN != 0) {
				setMessage(LocaleStrings.getString("D_38_JVAPP") + KVMSharing.KVM_CLIENT_USERNAME
						+ LocaleStrings.getString("D_39_JVAPP") + KVMSharing.KVM_CLIENT_IP);
			}

		} else if (getKVMShareDialog() != null) {
			setMessage(LocaleStrings.getString("D_51_JVAPP"));
		}
		if ((getMessage() != null) && (getMessage().length() > 0))
			localKVMRequestDialogThread.start();
		KVMSharing.KVM_REQ_GIVEN = 0;
		KVMShareDialog.isMasterSession = true;
		if (isFullPermissionRequest()) {
			getInstance().getJVMenu().removeFullPermissionMenuItem();
			getInstance().getJVMenu().addBlockPermissionMenuItem();
			this.m_KVMClnt.sendGetUserMacro();
			if (this.m_wndMode) {
				OnChangeMenuState_KVMPartial(getM_wndFrame().getMenu(), true);
				getM_wndFrame().getToolbar().OnChangeToolbarIconState_KVMPartial();
			} else {
				OnChangeMenuState_KVMPartial(getM_fsFrame().getMenu(), true);
			}
		}

		getM_frame().onStopVMediaRedirection(1);
	}

	private void onKVMPartialPermission(byte paramByte) {
		byte b = paramByte == 6 ? 2 : paramByte;

		Debug.out.println(" onKVMPartialPermissionpermission: permission" + paramByte + "  kvmpermission:" + b);
		getOEMManager().getOEMKvmClient().enableMenuOnKVMPartialPermission(b);
		if (b == 2) {
			KVMRequestDialogThread localKVMRequestDialogThread = null;
			localKVMRequestDialogThread = new KVMRequestDialogThread();
			if (KVMSharing.KVM_REQ_GIVEN == 0) {
				getM_frame().onStopVMediaRedirection(0);
				setMessage(LocaleStrings.getString("D_57_JVAPP") + KVMSharing.KVM_CLIENT_USERNAME
						+ LocaleStrings.getString("D_39_JVAPP") + KVMSharing.KVM_CLIENT_IP);

			} else if (paramByte == 6) {
				setMessage(LocaleStrings.getString("D_67_JVAPP") + "\n" + LocaleStrings.getString("D_40_JVAPP")
						+ KVMSharing.KVM_CLIENT_USERNAME + LocaleStrings.getString("D_39_JVAPP")
						+ KVMSharing.KVM_CLIENT_IP);

			} else {
				setMessage(LocaleStrings.getString("D_40_JVAPP") + KVMSharing.KVM_CLIENT_USERNAME
						+ LocaleStrings.getString("D_39_JVAPP") + KVMSharing.KVM_CLIENT_IP);
			}

			localKVMRequestDialogThread.start();
		}
		KVMSharing.KVM_REQ_GIVEN = 2;
		KVMShareDialog.isMasterSession = false;
		if ((getVMDialog() != null) && (getVMDialog().isShowing())) {
			getVMDialog().disposeVMDialog();
		}

		if (getSoftKeyboard() != null) {
			getSoftKeyboard().closeSoftKeyboard();
		}
		if (this.m_wndMode) {
			OnChangeMenuState_KVMPartial(getM_wndFrame().getMenu(), false);
			getM_wndFrame().getToolbar().OnChangeToolbarIconState_KVMPartial();
		} else {
			OnChangeMenuState_KVMPartial(getM_fsFrame().getMenu(), false);
		}
		if (isFullPermissionRequest()) {
			setFullPermissionRequest(false);
		} else {
			getJVMenu().removeBlockPermissionMenuItem();
			getJVMenu().addFullPermissionMenuItem();
		}
		getInstance().getJVMenu().getMenu("SoftKeyboard").setEnabled(false);
		getInstance().getM_wndFrame().getToolbar().getKbdBtn().setEnabled(false);
		getInstance().getM_wndFrame().getM_status().enableStatusBar(false);

		getInstance().getJVMenu().getMenuItem("RequestFullPermission").setEnabled(true);
	}

	public void onSendHostLock(byte paramByte) {
		this.m_KVMClnt.onSendLockScreen(paramByte);
		changeHostDisplayLockStatus((short) paramByte);
	}

	public void changeHostDisplayLockStatus(short paramShort) {
		getJVMenu().notifyMenuStateEnable("VideoHostDisplayLock", false);
		getJVMenu().notifyMenuStateEnable("VideoHostDisplayUnlock", false);
		if ((paramShort == 0) || (paramShort == 2)) {
			if (paramShort == 0)
				getJVMenu().notifyMenuStateEnable("VideoHostDisplayLock", true);
			getM_wndFrame().getToolbar().turnOnHostDisplayButton(true);

			getJVMenu().getMenuItem("VideoHostDisplayLock").setMnemonic('n');
			getJVMenu().getMenuItem("VideoHostDisplayLock").setAccelerator(KeyStroke.getKeyStroke(78, 8));

			getJVMenu();
			JVMenu.getMenuMnemonics().put("VideoHostDisplayLock", Character.valueOf('n'));
			getJVMenu();
			JVMenu.getMenuAccelerator().put("VideoHostDisplayLock", KeyStroke.getKeyStroke(78, 8));

			getJVMenu().getMenuItem("VideoHostDisplayUnlock").setMnemonic('\000');
			getJVMenu().getMenuItem("VideoHostDisplayUnlock").setAccelerator(null);
			getJVMenu();
			JVMenu.getMenuMnemonics().remove("VideoHostDisplayUnlock");
			getJVMenu();
			JVMenu.getMenuAccelerator().remove("VideoHostDisplayUnlock");
		} else if ((paramShort == 1) || (paramShort == 3)) {
			if (paramShort == 1)
				getJVMenu().notifyMenuStateEnable("VideoHostDisplayUnlock", true);
			getM_wndFrame().getToolbar().turnOnHostDisplayButton(false);

			getJVMenu().getMenuItem("VideoHostDisplayUnlock").setMnemonic('n');
			getJVMenu().getMenuItem("VideoHostDisplayUnlock").setAccelerator(KeyStroke.getKeyStroke(78, 8));

			getJVMenu();
			JVMenu.getMenuMnemonics().put("VideoHostDisplayUnlock", Character.valueOf('n'));
			getJVMenu();
			JVMenu.getMenuAccelerator().put("VideoHostDisplayUnlock", KeyStroke.getKeyStroke(78, 8));

			getJVMenu().getMenuItem("VideoHostDisplayLock").setMnemonic('\000');
			getJVMenu().getMenuItem("VideoHostDisplayLock").setAccelerator(null);
			getJVMenu();
			JVMenu.getMenuMnemonics().remove("VideoHostDisplayLock");
			getJVMenu();
			JVMenu.getMenuAccelerator().remove("VideoHostDisplayLock");
		}

		if ((KVMSharing.KVM_REQ_GIVEN == 2) || (this.powerStatus == 0)) {
			getJVMenu().notifyMenuStateEnable("VideoHostDisplayUnlock", false);
			getJVMenu().notifyMenuStateEnable("VideoHostDisplayLock", false);
		}
	}

	public String[] getExceptionMenuList(String[] paramArrayOfString) {
		String[] arrayOfString1 = JVMenu.KVMPartialExceptionSOCMenuItems;
		String[] arrayOfString2 = JVMenu.KVMPartialExceptionOEMMenuItems;
		String[] arrayOfString3 = null;

		if ((arrayOfString1 != null) && (arrayOfString2 != null)) {
			arrayOfString3 = new String[paramArrayOfString.length + arrayOfString1.length + arrayOfString2.length];
			System.arraycopy(paramArrayOfString, 0, arrayOfString3, 0, paramArrayOfString.length);
			System.arraycopy(arrayOfString1, 0, arrayOfString3, paramArrayOfString.length, arrayOfString1.length);
			System.arraycopy(arrayOfString2, 0, arrayOfString3, paramArrayOfString.length, arrayOfString2.length);

		} else if (arrayOfString1 != null) {
			arrayOfString3 = new String[paramArrayOfString.length + arrayOfString1.length];
			System.arraycopy(paramArrayOfString, 0, arrayOfString3, 0, paramArrayOfString.length);
			System.arraycopy(arrayOfString1, 0, arrayOfString3, paramArrayOfString.length, arrayOfString1.length);

		} else if (arrayOfString2 != null) {
			arrayOfString3 = new String[paramArrayOfString.length + arrayOfString2.length];
			System.arraycopy(paramArrayOfString, 0, arrayOfString3, 0, paramArrayOfString.length);
			System.arraycopy(arrayOfString2, 0, arrayOfString3, paramArrayOfString.length, arrayOfString2.length);
		} else {
			return paramArrayOfString;
		}
		return arrayOfString3;
	}

	public void onMediaLicenseStatus(byte paramByte) {
		Debug.out.println("ON MEDIA LICENSE STATE : " + paramByte);
		Debug.out.println("CURRENT MEDIA LICENSE STATUS : " + JViewer.getMediaLicenseStatus());
		if (JViewer.getMediaLicenseStatus() != paramByte) {
			JViewer.setMediaLicenseStatus(paramByte);
			if ((getInstance().IsCDROMRedirRunning()) || (getInstance().IsFloppyRedirRunning())
					|| (getInstance().IsHarddiskRedirRunning())) {

				getM_frame().stopVMediaRedirection(LocaleStrings.getString("D_60_JVAPP"));
			}
		}
	}

	public String getClientUserName() {
		Object localObject = "";
		String str1 = "";
		String str2 = null;
		str1 = System.getProperty("user.name");
		if (System.getProperty("os.name").startsWith("Windows")) {
			str2 = System.getenv("USERDOMAIN");
			str2 = str2.trim();
		}
		if ((str2 != null) && (str2.length() > 0)) {
			localObject = str2 + "\\" + str1;
		} else
			localObject = str1;
		return (String) localObject;
	}

	public void confirmationDialogResponse(int paramInt) {
		if (paramInt == 0)
			this.m_KVMClnt.sendKeyBoardLang();
	}

	public int getFreeCDNum() {
		return this.freeCDNum;
	}

	public void setFreeCDNum(int paramInt) {
		this.freeCDNum = paramInt;
		VMApp.getInstance().setFreeCDNum(paramInt);
	}

	public int getFreeFDNum() {
		return this.freeFDNum;
	}

	public void setFreeFDNum(int paramInt) {
		this.freeFDNum = paramInt;
		VMApp.getInstance().setFreeFDNum(paramInt);
	}

	public int getFreeHDNum() {
		return this.freeHDNum;
	}

	public void setFreeHDNum(int paramInt) {
		this.freeHDNum = paramInt;
		VMApp.getInstance().setFreeHDNum(paramInt);
	}

	public void updateFreeDeviceStatus() {
		if ((this.vmDialog != null) && (this.vmDialog.isShowing())) {
			VMApp.getVMPane().updateFreeDeviceStatus(0);
			VMApp.getVMPane().updateFreeDeviceStatus(1);
			VMApp.getVMPane().updateFreeDeviceStatus(2);
		}
	}

	public boolean isRenderFitToHost() {
		return this.renderFitToHost;
	}

	public void setRenderFitToHost(boolean paramBoolean) {
		this.renderFitToHost = paramBoolean;
	}

	public int getCurrentSessionId() {
		return this.currentSessionId;
	}

	public void setCurrentSessionId(int paramInt) {
		this.currentSessionId = paramInt;
	}

	public String getMacAddress(int paramInt, String[] paramArrayOfString) throws Exception {
		String str1 = null;
		String str2 = "ifconfig";

		if ((paramInt == 2) && (paramArrayOfString.length <= 0)) {
			return null;
		}

		String str3 = System.getProperty("os.name");

		if (str3.startsWith("Windows")) {
			str2 = "ipconfig /all";
		} else if ((str3.startsWith("Linux")) || (str3.startsWith("Mac"))) {
			str2 = "/sbin/ifconfig -a";
		} else {
			Debug.out.println("The current operating system '" + str3 + "' is not supported.");
			return null;
		}

		Process localProcess = Runtime.getRuntime().exec(str2);
		BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localProcess.getInputStream()));
		Pattern localPattern = Pattern.compile("([\\w]{1,2}(-|:)){5}[\\w]{1,2}");
		for (;;) {
			String str4 = localBufferedReader.readLine();

			if (str4 == null) {
				break;
			}

			if ((paramInt == 1) && (str4.contains(KVMSharing.KVM_CLIENT_OWN_IP)) && (str1 != null)) {
				break;
			}

			Matcher localMatcher = localPattern.matcher(str4);
			if (localMatcher.find()) {
				str1 = localMatcher.group();

				if (str1.contains(":")) {
					str1 = str1.replaceAll(":", "-");
				}
				if (paramInt == 2) {
					for (int i = 0; i < paramArrayOfString.length; i++) {
						if ((paramArrayOfString[i] != null) && (str1.compareToIgnoreCase("00-00-00-00-00-00") != 0)
								&& (paramArrayOfString[i].compareToIgnoreCase(str1) == 0)) {
							return null;
						}
					}
				}
			}
		}

		localBufferedReader.close();
		return str1;
	}

	public long getCurrentTime() {
		Calendar localCalendar = Calendar.getInstance();
		return localCalendar.getTimeInMillis();
	}

	public void setLocalport(int paramInt) {
		this.localport = paramInt;
	}

	public int getLocalport() {
		return this.localport;
	}

	public long getLastPckSent() {
		return this.lastPcktSent;
	}

	public void setLastPckSent() {
		this.lastPcktSent = getCurrentTime();
	}

	public void setLastPcktRecvd() {
		this.lastPcktRecvd = getCurrentTime();
	}

	public long getLastPcktRecvd() {
		return this.lastPcktRecvd;
	}

	public boolean getSessionLive() {
		return this.sessionLive;
	}

	public void setSessionLive(boolean paramBoolean) {
		this.sessionLive = paramBoolean;
	}

	public boolean getRetryConnection() {
		return this.retryConnection;
	}

	public void setRetryConnection(boolean paramBoolean) {
		this.retryConnection = paramBoolean;
	}

	public void onConnFailed() {
		this.m_RedirectionState = REDIR_STOPPED;
		if ((!JViewer.isWebPreviewer()) && (!JViewer.isBSODViewer())) {
			JOptionPane.showMessageDialog(this.m_frame, LocaleStrings.getString("D_3_JVAPP"),
					LocaleStrings.getString("D_4_JVAPP"), 0);

			getInstance().getM_frame().windowClosed();
		} else {
			getInstance().setWebPreviewerCaptureStatus(WEB_PREVIEWER_CONNECT_FAILURE);
		}
	}

	public boolean isLinuxClient() {
		return System.getProperty("os.name").toLowerCase().contains("linux");
	}

	public boolean isWindowsClient() {
		return System.getProperty("os.name").toLowerCase().contains("windows");
	}

	public boolean isMacClient() {
		return System.getProperty("os.name").toLowerCase().contains("mac");
	}

	public String getResolutionStatus() {
		return this.resolutionStatus;
	}

	public void setResolutionStatus(int paramInt1, int paramInt2) {
		if ((paramInt1 <= 0) || (paramInt2 <= 0)) {
			this.resolutionStatus = null;
		} else
			this.resolutionStatus = (paramInt1 + " x " + paramInt2);
	}

	public Connection getConnection() {
		return this.connection;
	}

	public void setConnection(Connection paramConnection) {
		this.connection = paramConnection;
	}

	public String getCurrentVersion() {
		return this.currentVersion;
	}

	public static IOEMManager getOEMManager() {
		return oemManager;
	}

	public int getResolutionChanged() {
		return this.resolutionChanged;
	}

	public void setResolutionChanged(int paramInt) {
		this.resolutionChanged = paramInt;
	}

	public String getIpmiPrivText(int paramInt) {
		String str = null;

		if (paramInt == this.PRIV_LEVEL_ADMIN) {
			str = LocaleStrings.getString("H_15_KVMS");
		} else if (paramInt == this.PRIV_LEVEL_USER) {
			str = LocaleStrings.getString("H_16_KVMS");
		} else if (paramInt == this.PRIV_LEVEL_OPERATOR) {
			str = LocaleStrings.getString("H_17_KVMS");
		} else if (paramInt == this.PRIV_LEVEL_PROPRIETARY)
			str = LocaleStrings.getString("H_18_KVMS");
		return str;
	}

	public FrameRateTask getFrameRateTask() {
		return this.frameRateTask;
	}

	public void setFrameRateTask(FrameRateTask paramFrameRateTask) {
		this.frameRateTask = paramFrameRateTask;
	}

	public void setSinglePortKvm(SinglePortKVM paramSinglePortKVM) {
		this.singlePortKvm = paramSinglePortKVM;
	}

	public InfoDialog getHidInitDialog() {
		return this.hidInitDialog;
	}

	public void setHidInitDialog(InfoDialog paramInfoDialog) {
		this.hidInitDialog = paramInfoDialog;
	}

	private boolean validateSessionToken() {
		boolean bool = true;

		URLProcessor localURLProcessor = new URLProcessor(JViewer.getWebSessionToken(), 1);
		int i = localURLProcessor.processRequest("https://" + JViewer.getIp() + ":" + 443 + "/rpc/WEBSES/validate.asp");
		try {
			if (i == 2) {
				bool = false;
			}
		} catch (Exception localException) {
			Debug.out.println(localException);
		}
		return bool;
	}
}

/*
 * Location:
 * D:\Users\tianlin\Downloads\JViewer.jar!\com\ami\kvm\jviewer\gui\JViewerApp.
 * class Java compiler version: 5 (49.0) JD-Core Version: 0.7.1
 */